We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29995
    • 3 Posts
    Hi
    I am new here and just started with modx. Its great and very easy to start with smiley

    Here is my question, I have a page where I want to add content blocks. Each block has a div arround and some styles and should have different text/images etc in it.
    Can I use chunks, template variables or snippeds for this?

    Second question would be if i have a fixed number of such blocks, do I have to insert for everyone a template variable for the text?

    Thanks in advance and
    Cheers
    Tim
      • 10487 MODX Staff
      • 1,535 Posts
      If your content blocks are changing on a page by page basis, then use Template Variables. Template Variables are assigned to a template and are made available for use in documents that use that particular template. You could use the ’HTML Generic Tag’ widget (set this when you create the TV) to output the content of the TV into a ’div’ tag.

      Once you have created the TVs, you can display them in your document/template/chunks by using the [*myTV*] syntax.
        Garry Nutting
        Senior Developer
        MODX, LLC

        Email: [email protected]
        Twitter: @garryn
        Web: modx.com