We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29796
    • 91 Posts
    hi... i have a problem wich i don’t know how to solve

    i installed geshi module and it works fine .... more or less .. whenever i look at some resource geshi works fine .. but in one resource instead of [*content*] i call my own snippet in wich i do a custom query to display multiple resources from one container .... in this case geshi in <pre> tag doesn’t work.

    Is there a way to run that geshi module at the end of my snippet ? or when i should run it .. so that geshi will work in my snippet ?

    My snippet:
    <?php
    $id = $modx->documentIdentifier;
    $query = $modx->db->query("SELECT id,pagetitle,content,longtitle FROM site_content WHERE parent=$id AND deleted=0 AND published=1 ORDER BY pagetitle");
    $results = $modx->db->makeArray( $query );
    
    echo '<br /><div id="accordion">';
    $i=0; foreach($results as $r){ $i++;
    	echo '<strong class="toggler">'.$i.'. '.$r['pagetitle'].'</strong>';
    	if($r['longtitle']) echo '<span class="fc3 fs10 subtitle">'.$r['longtitle'].'</span>';
    	echo '<div class="element">'.$r['content'].'<hr /></div>';
    }
    echo '</div>';
    ?>
    


    probably that isn’t the best way to get the data i want, but im a beginner in modx and i still learning it
      • 29796
      • 91 Posts
      ok.. where is modx comunity ?? all on vacation or what ? .. anyone ??
        • 3749
        • 24,544 Posts
        I don’t know of any simple way of running a plugin’s code from a snippet.

        I’m not sure it would work, but you could try putting your snippet in the content field of the resource. Geshi should process the output before the page is displayed.
          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
          • 29796
          • 91 Posts
          i call snippet in template, i tryed also to put it to content but doesn’t work .. any advice ?
            • 25663 MODX Staff
            • 12,272 Posts
            You may need to adjust the plugin execution order to put Geshi last. I’m not sure if plugins execute differently in Modules if at all. You might then need to put the Geshi code into your module as well.
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 29796
              • 91 Posts
              how i can change plugin execution order? doesn’t plugins being executed after snippets ??
                • 29796
                • 91 Posts
                is there any modx evolution developer who can give me an answer ? ..
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Ryan meant changing the order in which your plugins themselves get executed. Plugins get executed at their event points; this has no relation to when snippets get executed.

                  Go to Elements -> Manage elements and the Plugins tab. You’ll see a link at the top for "Edit Plugin Execution Order by Event". Find your plugin and if there are other plugins using the same event, change their execution order.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 4172
                    • 5,888 Posts
                    i installed geshi module

                    which geshi-module? Do you have a link where you got it?
                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!
                      • 29796
                      • 91 Posts
                      sottwell => Geshi is under "OnLoadWebDocument" and is the only one under this category. I have to put it somewhere else ?

                      Bruno17 => i used this module http://modxcms.com/extras/package/?package=167