We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41778
    • 6 Posts
    Hello there !

    I had tested Modx looooong time ago... And lately, I've been asked to update an HTML site to a new design a little bit more... modern... So all I'm doing right now is starting from scratch that new website.

    I have already designed websites in the past, but it's a first for me to use modx .

    And I guess I'm still confused with chunks and TVs... I thought I had it right, but... nope... Still having some issues with it...

    So if I understood correctly, chunks are basically the equivalents of php includes. While TV allows the placement of multiple content into one page.

    So far, no problem... I thought I had it. Now, if I want to use a part of a TV somewhere else on the website, that means I had a logic flaw and it should be turned into a chunk ?

    Are TV like simply saying "Ok, here you have something you want to write inside this box, type it here ?" while chunks are more "once typed, multiple use ?"

    If I'm wrong, feel free to correct me smiley

    Thanks for your help !
      • 22427
      • 793 Posts
      A chunk is just a piece of HTML code with a name, say "myChunk". You can insert its content via the tag [[$myChunk]] where ever you want it to appear in a template or in the content of a resource, also several times on the same page.
      What makes chunks really useful: They may contain in their HTML code also other MODX tags like a snippet call [[!mySnippet]], and so on...

      A TV is assigned to a template (hence its name). The back end editor can set its value on a per page basis, and this value is evoked in the template via the tag [[*myTV]].
      You can use this tag several times on a page, but always with the same output. For example, you can not put different images on a page using the same image TV. But there are plugins for such elements you want for multiple use on the same page.
        • 41778
        • 6 Posts
        Okies smiley

        Many thanks ! This confirmed I finally had it right smiley

        Thanks for helping smiley
          • 10208 ☆ A M B ☆
          • 1,780 Posts
          But don't use PHP in your chunks, use snippets for PHP and call the snippet in the chunk.
            Frogabog- MODX Websites in Portland Oregon
            "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
            Having server issues? These guys have MODX Hosting perfected - SkyToaster