We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27500
    • 14 Posts
    Is it possible to call a snippet from a non-CMS page? I love MODx and all my new pages are built in it; but I have hundreds of pre-MODx pages which haven’t been converted/upgraded. My specific case is that I use a Ditto call in a sidebar to list the 5 most recent articles.
    On CMS pages I just use: [[Ditto? &parents=`500` &sortBy=`pub_date` &tpl=`bulletlist` &display=`5` &hideFolders=`1`]]
    I don’t think I can just use something like the following on a standard HTML page: <!–#include virtual=”/assets/snippet.ditto.php&parents=`500`&sortBy=`pub_date`&tpl=`bulletlist`&display=`5`&hideFolders=`1`” –>
    What am I missing? Do you have to get the mySQL DB in there somewhere? Is this even possible....without a lot of hacks? Thanks.

      • 22303 MODX Staff
      • 10,725 Posts
      It’s possible but you’ll need to use the add-on called MODxAPI for the current releases. And I’m not sure how much is actually functional that way.

      This is one of many reasons why Revolution (MODx 2.0) is being developed. It will feature a fully-functional API that can easily be used in other PHP scripts.