We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30194
    • 14 Posts
    Hey everyone I am brand new at modx and I have been reading as many tutorials etc on it. I am pretty experienced in css and all that jazz but I have a quick question about the modx specific tags. Right now I have a template with a content tag for my main content and I have a side bar to the left of it. In that side bar I want a favorites links with a bunch of links displayed, an About the Author blurb, and some other link sections. If I make a document for each section how can I add each section into the code? Also if a document for each isnt the way to go please let me know I am looking for input. For example what tag instead of [*content] can I use?
      • 23299
      • 1,161 Posts
      I am a new MODx’er myself but the general idea is to strip your template down to the bare minimal with as many of the MODx dynamic placeholders as you can. Check out Chunks for example. Using Chunks is great as it can save a ton of work down the road. Rather than including all the code for the footer on all your pages you just create a footer Chunk like {{footer}} with all your footer details. Then you just add the Chunk call to your template etc. Then when you want to change the details of your footer (say like when rolling into a fresh year) you just edit the one Chunk and all your pages are updated automatically. Very cool.

      You can use Chunks all over your site. If you have some sidebar text that will appear on all your pages then create a Chunk with that text and then just use the call for that Chunk. This makes editing that wording down the road so much easier. I use Chunks for static navigation sections as well.

      I am sure that the more learned guys can explain this better though.

      Max
        • 1343 ☆ A M B ☆
        • 2,213 Posts
        The best part of modx (if there is such a thing) is there are several methods you can use to get the desired outcome.

        The simplest method would be to use a chunk which is the same anywhere you use it. You update it once and every page gets updated so it’s good for content you change regularly that needs to be the same on every page, content you don’t change much, but need that same functionality (footers come to mind), and similar items.

        Another method is you can use a TV or Template Variable which can be used several ways:
        - Include another document using @DOCUMENT (see documentation) I personally like this method to build sidebars.
        - Run a WYSIWYG Editor (ie TinyMCE) which adds another content box when your editing a page
        - And likely a few others I don’t know about....

        The nice thing/down fall of TVs is you can change them on any page you want, but if you change them you can’t really do a bulk change if you need new content on all of the pages. Well in the first example you change the document and it updates them all, but if you change the document ID then that changes things.

        Anyways TVs are very powerful granted I feel they need much better documentation...

        I hope that helps some!
        AMDbuilder
          Patrick | Server Wrangler
          About Me: Website | Tweets |  MODX Hosting