We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34459
    • 134 Posts
    Hi, it's more of a "how do you do it?" question. I am looking for a more efficient way to manage tv and templates. I've learned the hard way that making a "custom template" nearly for every page is not good. The question is how to manage different tv's in 1 template? The thing is that if you're using 1 template every time you edit a page you have all tv assigned to it listed and that causes a lot of chaos. Any ideas how to avoid it?
      Check out blackflow.pl
      • 43864
      • 151 Posts
      I'm not sure I understand the question but if you're looking for a way to use one TV on multiple resources than use getresourcefield and you will get the job done. (first install the plugin through the pakketmanager)

      for example: you want the address on every page but you want the user to only change it on one resource, let's say the resource with id 5 because this resource uses a different template than the rest. You create a TV address and point it to that template, so it won't be available on the other resources.

      [[getResourceField? &id=`5` &field=`address` &processTV=`1`]]


      Hope this will help.
        • 34459
        • 134 Posts
        no, that’s not what i meant. I want to use a single template to every resource. But it's a problem because when you edit a resource, you get every tv, binded to our template listed, and that’s what I am trying to avoid.
          Check out blackflow.pl
          • 43864
          • 151 Posts
          Take a duplicate of the template and use this with the TV's and one resource.
            • 3866 ☆ A M B ☆
            • 350 Posts
            You could try creating differrent categories and put tv's into, for example, layout options, script options, developer only etc etc.

            This way you can use form customization to only allow those tvs you want a client to see and use to be available and hide the rest.

            If you do have a lot of tv's, it can be a bit confusing for clients, but I do find categorizing tv's helps.
              Helen Warner
              Number one pixel!
              Proud to be linked with MODX at Crimson Pixel
              • 34459
              • 134 Posts
              @funky -that's what I am trying to avoid- using different template for every resource.

              @boomerang
              How can I do that? I know how to group them but how to assign these groups in to resources and template? If you are referring to permissions that doesn't do the job. If for example I have two pages:
              1.News -(tv's adding news)
              2.About us (tv containing some text)
              and they both use the same template, if the client will edit one of the templates he will see both tv's with news and tv's with text which tends to confuse them. [ed. note: blackflow last edited this post 14 years, 7 months ago.]
                Check out blackflow.pl
                • 3866 ☆ A M B ☆
                • 350 Posts
                Under the Elements tab at the bottom you can create more categories.

                Then in form customization you can make further changes to help clients understand TV's - I tend rename that whole section Page Variables for clients. You can also switch TVs on and off if you don't want clients to change particular variables.

                So if you have a News page, create a category called News and then it makes it more obvious to clients that the variables relating to the News page can be found under that category. You can create as many categories as you want.

                Hope that helps. There is more here about Form Customization http://rtfm.modx.com/display/revolution20/Customizing+the+Manager

                  Helen Warner
                  Number one pixel!
                  Proud to be linked with MODX at Crimson Pixel
                  • 34459
                  • 134 Posts
                  this is exactly what I was looking for...and with the restrictions I can easily make my work idiot-proof. Thanks!
                    Check out blackflow.pl
                    • 34459
                    • 134 Posts
                    @boomerang
                    Dose restraining TV to different resource with only one template works for you?
                      Check out blackflow.pl
                      • 3866 ☆ A M B ☆
                      • 350 Posts
                      I've used a mixture of resource groups and TV restrictions to control what clients see on a particular template.

                      There is a bit about constraints and ids, but I've not actually used that yet.

                      There are details about Form Customization in Bob Ray's MODX The Official Guide which I found useful but constraints I haven't yet used http://modx.com/learn/modx-books/modx-the-official-guide/

                      Anyone else like to add their experience with form customization and constraints?
                        Helen Warner
                        Number one pixel!
                        Proud to be linked with MODX at Crimson Pixel