We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11429
    • 90 Posts
    [EDITOR’S NOTE: etomite does not allow direct linking to their snippet repository...URL removed]

    besides changing etomite to modx is there anything else needed to make this work ?

    $resourceparent = isset($faqFolder) ? $faqFolder : $etomite->documentIdentifier;
    $output = "<script type="text/javascript">
    function expand(thistag) {
       styleObj = document.getElementById(thistag).style;
       if (styleObj.display=='none') {styleObj.display = '';}
       else {styleObj.display = 'none';}
    }
    </script>";
    
    $faq = $etomite->getActiveChildren($faqFolder,'pagetitle', 'ASC', $fields=' id, pagetitle, content');
    $limit=count($faq);
    if($limit<1) { 
       $output .= 'No Questions Found<br />'; 
    } 
    for ($y = 0; $y < $limit; $y++) {
    $output .= '<div onclick="expand(''.$faq[$y]['id'].'');" style="cursor:pointer;"><div class="faq">'.$faq[$y]['pagetitle'].'</div><div id="'.$faq[$y]['id'].'"  style="display:none">'.$faq[$y]['content'].'</div></div><br />';
    }
    
    return $output;
      • 25663 MODX Staff
      • 12,272 Posts
      You don’t even have to change that, but have you just tried it?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 11429
        • 90 Posts
        yes i tried it as is and it didn’t appear to work