We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9162
    • 39 Posts
    Hi there,

    I’ve created a TV for my main template which most of my pages are using. I’ve added data to it using Quick Editor from my home page, and it works fine there. But on every other page, the TV is there, but it doesn’t contain the data as on the home page, it’s just empty. Is this how they work, or is there a way to get the TV and it’s data shared across all pages using that certain template?

    Thanks
    Ettiene
      • 4310
      • 2,310 Posts
      You would set a default value within the TV, then any new pages would have that value unless you overwrite it.
        • 9162
        • 39 Posts
        Thanks for the reply.

        Would one then be able to edit this default value somehow from a page on the frontend using QE?
          • 4310
          • 2,310 Posts
          Yes, if the TV is made like this [*#MyTV*] the hash enables QE to access it.
            • 9162
            • 39 Posts
            Sorry for the confusion with my previous question. What I meant to ask was this:

            Is there a way I can edit the TV on my home page (for example) and then that updated value will also display on another page where the TV also shows? I’ve tried it, but it looks like each page has it’s own "instance" of that specific TV. I’m trying to figure out how one can edit it once on any page and that change will reflect on every page that uses that template and TV.

            Makes sense?

            And thanks for the tip on how to get QE to pick it up. smiley
              • 36624
              • 535 Posts
              hello,

              is think the answer is here : http://modxcms.com/inherit-binding.html

                CTRL+SHIFT+U - Clear Cache
                CTRL+SHIFT+H - Hiding Heft Panel
                CTRL+SHIFT+N - Fast Create Resource
                CTRL+ALT+P - Preview Recource (in edit resorce window)
                CTRL+ALT+S - Save
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Or put your content as the "default value" when you create the snippet. Then it will show up anywhere the TV is embedded and can be changed or even emptied where it appears but is not wanted.
                  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
                  • 9162
                  • 39 Posts
                  Ok, Maybe I’m just not implementing the solutions correctly, but nothing is working like I’m hoping it would smiley

                  My understanding of the default value and the @INHERIT binding is that it basically just assigns a default value once to all instances of a TV on all the pages that use a certain template. But what needs to be done in order to edit the TV on one page and then that change reflects on all other pages? Because this is not working for me. If I edit it on one page (from the front-end using QE) then that change only reflects on that same page and the default value persists on all the other pages. I want it to act like a "shared" piece of editable code.

                  In my case it’s a tips section that sits in the left-sidebar of my website template, and I want it to be editable vie QE from the front-end, but also that it must show the same content throughout all pages.

                  I’m sorry guys. Maybe I just suck.

                  What I’ve done so far is this:

                  I’ve got a chunk that houses the sidebar content, and in that chunk I’m calling the TV like this [*#tv_tips*] . I’ve also assigned the TV to my template and given it a default value (not sure if it needs the INHERIT binding, but works without it) which populated all instances of the TV on my pages. I’m then calling the sidebar chunk in my main template. So everything works. But when I edit it on my home page, it changes there, but stays unchanged on all the other pages.

                  Thanks
                  Ettiene
                    • 4310
                    • 2,310 Posts
                    My understanding is that the @INHERIT value cascades down from the master value set in the TV from the Manager.
                    What you want is for a new value entered from the front end to work its way up and change the master value.
                    As far as I know this can’t be done as standard, you’d need a way to update the master value rather than the page value.
                    Someone else might be able to point you in the right direction of a custom snippet.
                    Maybe look at http://modxcms.com/forums/index.php/topic,8111.0/topicseen.html
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      That would defeat the purpose of TVs. Either they all get the "default" value, child pages inherit the value of their parent’s TV value via @INHERIT, or each page gets its own value.
                        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