We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2130
    • 5 Posts
    I searched for a topic similar to this one and found some things involving chunks in different folders and templates, but nothing specifically answering the question I have. I apologize if this has been answered before and I am wasting time and space.

    Here is my problem: I am creating a web site that has four lines of text at the top that stay the same throughout the site, but the site uses three templates. I created template variables for each line of text at the top and assigned them to the three templates. I realized that the problem was that the owner of the web site now has to go into every page of the site where the input fields for those variables are if any of those lines ever change. For example: Let’s say the site has 10 pages that all use one template with those four lines of text variables. One of those lines of text has the company’s phone number. Now the content editor has to change the phone number and has to go into every page to put the new phone number into the variable field on each page.

    Is there a way to make that top area with the four lines of text a chunk that is editable from one place and that shows up on all of the pages (templates)? This would be very simple if the content within the chunk wasn’t necessary to edit, but since I want to make it editable, I am trying to figure out a way. I messed around with bindings (@Document* and @Inherit*) but nothing seems to be working right. I have spent way too many hours trying to figure this out, so now I am coming to you for help.

    (Also - I have disabled QuickEdit completely because the person that I am creating the site for doesn’t want to use that. My question only pertains to the login area of Modx.)

    Thanks in advance!

    *Disclaimer: I am a web designer that knows HTML and CSS, but I am very new to CMS and PHP, so please excuse my lack of knowledge or silly questions. ;o)

    ~Angela
      • 1764
      • 680 Posts
      Chunks would probably be the easiest method. You could also use @INHERIT or @DOCUMENT but I think for your situation a chunk would be the best choice.

      Just create a new chunk with the your contact information in it and name it ContactInfo. Now in your template just put {{ContactInfo}} where you want the information.

      The one downside to chunks is your client will see the pure HTML by default with the option to use a richtext editor and you may have other chunks you’d rather them not have access to edit. In that case you can use @INHERIT or @DOCUMENT. I won’t get into that now because the chunk may suite you fine but if you want to try one of the bindings just let me know.
        • 2130
        • 5 Posts
        Thanks Adam! I am going to try the @INHERIT and see if I can get that to work. I think @INHERIT will be the best. If I understand it correctly - if the content editor changes the contact information on the parent document, then it will change on all other documents as well. I could also use a chunk. But this is a web site for a friend, and she knows nothing about HTML, so seeing a break tag would probably scare her. Haha.

        I already tried the @DOCUMENT and couldn’t get it to work right, so I think I will try @INHERIT.

        If @INHERIT doesn’t work like I need it to, I may try the @DOCUMENT once again to see if I just set it up wrong the first time.

        Thanks! shocked)
          • 1764
          • 680 Posts
          Well if anyone knows how to get @INHERIT to work it should be me so let me know if you have any questions. It should work especially well if you have all of your documents underneath one homepage.

          With @INHERIT just take one of your existing TVs and put @INHERIT as the deafault. Edit your homepage document and everything underneath it should be changed too.
            • 2130
            • 5 Posts
            Thanks! @INHERIT worked great. Just what I needed! shocked)
              • 32241
              • 1,495 Posts
              Quote from: arohner at Feb 08, 2006, 04:03 PM

              Thanks! @INHERIT worked great. Just what I needed! shocked)

              YEP!!!
              It’s one of my swiss army for creating a website with MODx. Believe me, I always setups a couple of TVs with @INHERIT as default value in it, even though I’m not really using the TV, but when you need, it will work like a charm. Thanks to Adam for that.

              Btw Adam, did you receive the bug report on @INHERIT? It’s a little bit out of topic though.
                Wendy Novianto
                [font=Verdana]PT DJAMOER Technology Media
                [font=Verdana]Xituz Media
                • 1764
                • 680 Posts
                Quote from: Djamoer at Feb 08, 2006, 04:33 PM

                Btw Adam, did you receive the bug report on @INHERIT? It’s a little bit out of topic though.

                Yes I did. I still haven’t gotten around to fixing it yet though. I’ll be sure to fix it before the next release.
                  • 32241
                  • 1,495 Posts
                  Quote from: aNoble at Feb 08, 2006, 08:01 PM

                  Yes I did. I still haven’t gotten around to fixing it yet though. I’ll be sure to fix it before the next release.

                  Sure thing, I’m not that concern about it though, but I just wanna know how the bug tracking system works. I think so far the bug tracked had done a great job for all of us here grin
                    Wendy Novianto
                    [font=Verdana]PT DJAMOER Technology Media
                    [font=Verdana]Xituz Media