We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4749
    • 623 Posts
    Has there been any kind of implementation of an FAQ manager? Or is there an existing module or plugin that can accommodate a client to add FAQs one at a time? Savvy.

    Thanks.
      The MODx has you...
      Utah Web Design
      • 7455
      • 2,204 Posts
      we use ditto for that

      or you could use this little snippet:

      <?php
      $resourceparent = isset($faqFolder) ? $faqFolder : $modx->documentIdentifier;
      $output = "<script type='text/javascript'>
      function expand(thistag) {";
      
      $faq = $modx->getActiveChildren($faqFolder,'menuindex', 'ASC', $fields=' id, pagetitle, content');
      $limit=count($faq);
      if($limit<1) { 
         $output .= 'No Questions Found<br />'; 
      } 
      for ($y = 0; $y < $limit; $y++) {
      $output .= "document.getElementById('".$faq[$y]['id']."').style.display='none';";
      }
      $output .=" styleObj = document.getElementById(thistag).style;
         if (styleObj.display=='none') {styleObj.display = '';}
         else {styleObj.display = 'none';}
      }
      </script>";
      
      
      $faq = $modx->getActiveChildren($faqFolder,'menuindex', 'ASC', $fields=' id, pagetitle, content');
      $limit=count($faq);
      if($limit<1) { 
         $output .= 'No Questions Found<br />'; 
      } 
      for ($y = 0; $y < $limit; $y++) {
      $output .= "<div><div class='faq' onclick=\"expand('".$faq[$y]['id']."');\" style='cursor:pointer;'>".$faq[$y]['pagetitle']."</div><div id='".$faq[$y]['id']."'  style='display:none'>".$faq[$y]['content']."</div></div>";
      }
      
      return $output;
      ?>
      


      Dimmy
        follow me on twitter: @dimmy01
        • 7231
        • 4,205 Posts
        I think that BobRay has a nice FAQ snippet with collapsing answers. I think that you can just put the FAQs in a container (a document for each question) and manage them that way with Ditto (as Dimmy pointed out)...that is what I do.
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don&#39;t know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 4749
          • 623 Posts
          I looked for BobRay’s snippet, but couldn’t find it. I was hoping to avoid using 1 doc per faq, because the list is long. But, I may end up leaving it that way, since I already have it working. Thanks for the input! And thanks for the snippet Dimmy!
            The MODx has you...
            Utah Web Design
            • 4749
            • 623 Posts
            What is the name of that snippet? What are the parameters? Sorry, I know it’s a silly question, but I’m not sure how to implement it. It seems it returns the documents of a folder and displays them in a clickable javascript container, but not quite sure how to "control" it or set it up. Many thanks.
              The MODx has you...
              Utah Web Design
              • 7455
              • 2,204 Posts
              there is only one option and that is &faqFolder=

              that will grabb al documents from that folder and creates a FAQ

              the name I have no idea FAQsnippet
                follow me on twitter: @dimmy01
                • 7231
                • 4,205 Posts
                BobRay’s snippet is EZFaq. I think it is a single document with a specific syntax for Q/A. There is a working demo and tutorial at: http://bobsguides.com/ezfaq-tutorial.html

                It looks like a nice solution.
                  [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

                  Something is happening here, but you don&#39;t know what it is.
                  Do you, Mr. Jones? - [bob dylan]