We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37118
    • 2 Posts
    Im new to MODx, and very glad i found this CMS. I am currently working on a project (first time with modx) and is is possible to by making a snippet in php manage the templates regions

    ie.

    <?php
    function mytheme_regions() {
      return array(
        'right' => t('right sidebar'),
        'content' => t('content'),
        'header' => t('header'),
        'footer' => t('footer'),
        'floater' => t('floater'),
        'inline1' => t('inline 1')
      );
    }
    ?>


    What i mean is how can i manage the diffrent regions of my template.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      MODx templates are not like those of other CMSs. A template is simply the HTML you would use in an ordinary .html file, with the dynamic parts (menus and individual page content, for example) inserted by means of MODx tags.

      You'll need to learn to understand how to use snippets (for PHP code, used for menus and news or blog listings, among other things), chunks (chunks of commonly used HTML code, frequently used for footer content) and Template Variables (TVs, probably the most powerful features of the MODx templating system.

      There are a number of tutorials and articles about templates; here's one https://forums.modx.com/thread/18244/tutorial-for-creating-a-template-with-revolution
        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