On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hi,

    My site contains around 150 pages, all using 1 template. I’ve created two TV’s attached to this template that are used on every page. On a small subset (30 pages), I need to have 10 extra TV’s. Right now, I’ve created the 10TV’s and attached them to the main template. However, this of course makes these TV’s visible to all other documents where they are not needed.
    Without duplicating the template, how would you manage TV’s in this case?
    • um... I would duplicate the template.
        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
      • Uhm, ok. laugh

        The only reason I created 30 pages was to have an actual page to link to. I could have also made an ajaxrequest from the database that would contain the TV values, however then there’s no link to point people to directly.
        Is there no way to, f.e. creating an empty template, linking the 10TVs and grabbing those pages in another way?
        • I do believe that one of the major snippets (Ditto, I think) does something with "hidden TVs", TVs that are not assigned to any template. This might be more what you are looking for. Maybe you can see how it does this.
            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
          • I’ve taken your advice and duplicated the entire template into a chunk, which is called from the new template. If I make any changes to the main template, it’s just a copy/paste to this chunk to keep things updated!

            Thank you.