We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41039 ☆ A M B ☆
    • 29 Posts
    Hi, folks

    I raised a bug yesterday (http://tracker.modx.com/issues/9701) but thought I would ask in the forums to see if anyone else has experienced a similar issue.

    When creating a template variable that exists in a footer chunk, which is included in multiple templates, the output html from the template variable shows on my MODX site homepage, but when navigating to other pages, the value is empty.

    I have tried clearing the MODX cache and browser cache to see if this would resolve the issue, but to no effect. I have setup other template variables within the footer chunk which work without any issues. I have cross-referenced them to see if there was anything I was missing, but they are setup exactly the same.

    Any ideas?

    Cheers

    Tom

    This question has been answered by tom_ireland. See the first response.

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Are you sure that particular TV is attached to the other resources' templates?
        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
        • 41039 ☆ A M B ☆
        • 29 Posts
        Quote from: sottwell at Mar 23, 2013, 11:37 AM
        Are you sure that particular TV is attached to the other resources' templates?

        Hi, sottwell

        I couldn't be sure. How would I check that? I haven't enabled the access on the other templates in the TV settings as I don't need it to be edited on the other templates, just on the homepage. But, the links have to be visible.
          • 20196
          • 13 Posts
          You need to "attach" the TV to the template in question. If it is not "attached" to a template, it doesn't matter how much you call it.
          I think that was what Sottwell was suggesting.
            • 42046
            • 436 Posts
            If for some reason you really don't the TV's field to show up in other page's template variables tab but still want to call it on those other pages, you could use Bob's ShowTv snippet:

            http://modx.com/extras/package/showtv2

            http://bobsguides.com/showtv-tutorial.html
              • 41039 ☆ A M B ☆
              • 29 Posts
              Thanks for the suggestions everyone. The weird thing is that I have other template variables that are not "attached" to other pages and they work fine e.g. css path. All my TVs are in chunks as opposed to the templates themselves and this is the only one that is not working. The one I'm having the problem with outputs a URL. All the others output text.
                • 42046
                • 436 Posts
                Is it a Resource List TV? I think I'm correct in the assumption that Resource List TVs need to be processed in order to output a URL otherwise they'll output the resource ID number.
                  • 41039 ☆ A M B ☆
                  • 29 Posts
                  Correct, Dan. It is a Resource List TV. I noticed that the resource ID number is output when the TV output was set to text but output the resource URL when URL output is enabled. Do I need to set the sort order on each Resource TV?
                    • 42046
                    • 436 Posts
                    I'm not sure if that would help. But you could set the output as text if it's outputting the resource ID fine, then change the link in the chunk to something like this (assuming the TV is called myTV)

                    [[~[[+myTV]]]]


                    or *myTV or +tv.myTV depending on how the chuck is being used.
                      • 41039 ☆ A M B ☆
                      • 29 Posts
                      Yeah, Dan. That works fine. Still only showing on the homepage though, not on the others. sad

                      It's bizarre. All my other TVs in my chunks work fine.