We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4749
    • 623 Posts
    Bob,
    I just noticed that the Anchors don’t disappear completely, they appear when I click on the faq right below the anchor. I hope that helps. Thanks again.
      The MODx has you...
      Utah Web Design
      • 29525
      • 388 Posts
      Thanks Bob! I found it.

      Terry
        www.terrybarthdesign.com
        • 4749
        • 623 Posts
        Bob,
        Have you had a chance yet to look into the anchor issue? Many thanks.

        -Dan
          The MODx has you...
          Utah Web Design
          • 3749
          • 24,544 Posts
          Quote from: cbaone at Jun 18, 2008, 07:01 PM

          Bob,
          Have you had a chance yet to look into the anchor issue? Many thanks.

          -Dan

          Sorry, no. I’m hoping to get to it in the next day or two.

          Bob
            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
            • 4749
            • 623 Posts
            Thanks Bob! grin
              The MODx has you...
              Utah Web Design
              • 3749
              • 24,544 Posts
              @cbaone:

              This is still a work in progress, but if you replace the section of code in ezfaq.inc.php with this:

              if ( ($items[0] != "") && ($items[1] != "") ) {
              
                   $output .= '<p id="faq'.$itemCount.'-title" class="handcursor">';
                   $output .= '<span class="faqQuestion">';
                   $output .= $items[0];
                   $output .= '</span>';
                   $output .= '</p>';
                   $aArray = explode("Extra:",$items[1]);
                   $output .= '<div id="faq'.$itemCount.'" class="switchgroup1">';
                      //$output .= '<p class="faqAnswer">';
                   $output .= $aArray[0];
                      //$output .= '</p>';
                   $output .= '</div>';
                   if ($aArray[1] != "") {
                     $output .= $aArray[1];
                   }
              
                }


              And then put your code in the faq content file exactly like this:

              Q: question
              A: Answer
              Extra: Your anchor code here

              Your anchor code will be placed between the items rather than in them. I don’t think this will break any existing implementations and it should help others who want to add headings for various FAQ sections.

              Your navigation section will have to go at the top of the FAQ document, just before the snippet call.

              Try it and let me know if you can get it to work.

              Bob
                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
                • 4749
                • 623 Posts
                Bob,
                Implemented it and it still works, but nothing changed. Don’t I need to define "Extra:"?
                  The MODx has you...
                  Utah Web Design
                  • 3749
                  • 24,544 Posts
                  Quote from: cbaone at Jul 02, 2008, 01:37 PM

                  Bob,
                  Implemented it and it still works, but nothing changed. Don’t I need to define "Extra:"?

                  You should just need to put Extra: in front of the anchor code in your FAQ content document. Like this:

                  Q:Your question
                  
                  A:Your answer
                  
                  Extra:Your anchor code here
                  
                  Q:Another question
                  
                  A:Another answer
                  
                  Q:Another Question
                  
                  A:Another Answer
                  
                  Extra:More anchor code


                  Be sure to clear your site cache and browser cache before testing.

                    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
                    • 4749
                    • 623 Posts
                    Bob,
                    Still not getting it to work. I tried to implement your changes, but it seems I’m not doing it correctly. Here’s what I have changed from the original code to work with the mootools accordion:
                      if ( ($items[0] != "") && ($items[1] != "") ) {
                    
                         $output .= '<h3 class="toggler slide">'.$items[0].'</h3>'."\n";
                         $output .= '<div class="element slide">';
                         $output .= $aArray[0];
                         $output .= $items[1].'</div>'."\n";
                         if ($aArray[1] != "") {
                           $output .= $aArray[1];
                      }
                      $itemCount++;
                    }
                    $output .= '</div>'."\n"; // end of accordion div


                    Let me know what I did wrong if you can see it. With this code it still works, but it’s also swallowing up the anchor just like before. Thanks.

                      The MODx has you...
                      Utah Web Design
                      • 3749
                      • 24,544 Posts

                      Bob,
                      Still not getting it to work. I tried to implement your changes, but it seems I’m not doing it correctly. Here’s what I have changed from the original code to work with the mootools accordion:


                      Try this (I marked the two lines you need to change with an asterisk):

                        if ( ($items[0] != "") && ($items[1] != "") ) {
                      
                           $output .= '<h3 class="toggler slide">'.$items[0].'</h3>'."\n";
                           $output .= '<div class="element slide">';
                      *     $aArray = explode("Extra:",$items[1]);  // added  - Split the answer at the "Extra:" tag (if there is one).
                           $output .= $aArray[0];   // output the answer up to the "extra:" tag.
                      *     $output .= '</div>'."\n";   // changed  -- Close the answer div.
                           if ($aArray[1] != "") {               // If there's an Extra: part, add it.
                             $output .= $aArray[1];
                        }
                        $itemCount++;
                      }
                      $output .= '</div>'."\n"; // end of accordion div



                      There’s no need to output $items[1] because $aArray[] is it.

                      I can’t test this because I don’t use the accordian stuff. Let me know if it works.

                      Bob

                        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