We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5043
    • 3 Posts
    I usually include bits and peices of php inside my pages. I use joomla (which has addons for this), and i am trying out modx
    However,I cannot find any information on how to add php code to content.
    Is this possible yet??
      • 28506
      • 16 Posts
      The MODx way is to make a small snippet and include that. It’s a cleaner way without mixing content and code too much.

      There are some good examples installed. Just read some code in Resources/Snippets.
      • Quote from: chess at Apr 29, 2006, 07:09 AM

        I usually include bits and peices of php inside my pages. I use joomla (which has addons for this), and i am trying out modx
        However,I cannot find any information on how to add php code to content.
        Is this possible yet??

        MODx approaches this a little differently. Within MODx documents, you have various elements of content (see Manage Resources is the manager) that each interact with the MODx core in a different way. To add PHP code to a page, you would create a Snippet and then include that in the page using the snippet tags [[SnippetName? &param1=`paramValue`]]. Similarly, a Chunk would be used to encapsulate sections of HTML, or define a reusable template of HTML for use within a Snippet or Plugin, etc., and so on. In this way, the designers and developers of a site can completely isolate the editable areas of content within the site for content editors to deal with. This almost complete separation of presentation from application logic, is one of the key benefits of MODx IMO.

        I hope that helps a little, and I encourage you to review the MODx documentation and ask more questions in the forum. We have a great community here, and we’re glad to have you with us.