Hi,
I hope this isn’t a repost, but I’ve been unable to find out how to do this after weeks of searching. I have a client who would like to edit an area of the page, so I set up a template variable for it. This works, except the area must be changed on every page of the site, and this isn’t something the client has time to do.
Is it possible to have a template variable that is the same on every page and can therefore be changed once? The client is not confident enough to go through the admin area and edit a chunk.
Thanks in advance,
Don
If you set a default value for the Template Variable it should carry over to all templates the variable is assigned to.
Thanks for the reply, but the issue isn’t the default value. When the client changes the content through the front end of the site, the edit only applies to the one page editted.
I tried putting the snippet getField onto a second template and applying it to the other pages, but I can’t seem to get the getField snippet to output anything.
I am confused why something so fundamental would be omitted in this CMS.
-
MODX Staff
- 10,725 Posts
That is the way template variables work. QuickEdit does not provide the ability to edit the default value for template variables from the front-end; the users would have to edit the default value of the template variable in the manager interface. If it’s something that should be editable site-wide on all pages and always reflect the global value, a Chunk is more appropriate, but is still not editable from QuickEdit.
Also note, QuickEdit is an add-on to MODx, so you can extend it to do these things (I’m surprised no has yet TBH).
What version of modx release are you running. I just tested this in the latest version and had no problems with the @DOCUMENT biding. I have noticed this sort of behavior before when using the @CHUNK binding in a project a while back but have not noticed it recently. I am guessing that it is somehow related to the cache, so maybe try changing the cacheable settings for the documents as a test.
Apparently what you have done, should work fine. Make sure that you aren’t using RTE on that particular TV.