We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13354
    • 7 Posts
    Has anyone or know of a way to extend Quip, to support custom fields. Im after a Review system that supports custom fields such as a rating of 1-5 for multiple areas as well as comments that general public can leave and admin as to approve before displaying on the front end.

    Has anyone done something similar or used something for this purpose?
      • 3749
      • 24,544 Posts
      I haven't done it, but I see that Quip does process hooks, so it might be possible to add a hook that saves your rating somewhere. An unused Resource field would be best if there is one (e.g., introtext or description). If not, you could use a TV.

      The documentation for Quip hooks is pretty much missing as far as I can tell, but it should work the same as Shaun's other extras that have hooks. It may take some trial and error, but it should be possible.

      The relevant properties for quip would be &preHooks and &postHooks and they would contain the name of your custom snippet.

      This is a completely wild guess, but if you created an input field in your quip Tpl called 'quip_rating' the code of the &postHook snippet might look like this for starters:

      $rating = $hook->getValue('quip_rating');
      /* For debugging */
      $modx->log(modX::LOG_LEVEL_ERROR, 'Post Hook is executing');
      $modx->log(modX::LOG_LEVEL_ERROR, 'Rating: ' . $rating);
      
      /* Save the rating here */
      
      return;


      If that puts the selected rating in the MODX Error log, you're on the right track and just need to figure out how to save it.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting