On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Old thread, but the GetResourceField snippet worked for me in case anyone else comes by here searching for an answer.

    Scenario: You want clients to be able to edit content in your templates site-wide, but you don't want them messing with your templates or chunks.

    I first tried the @DOCUMENT TV approach and it had a couple of flaws.

    1. It introduced TVs that the client shouldn't touch for fear of breaking them, and explaining why they could edit one TV and not another was going to be tricky.
    2. It was a bugger to get it to work with lots of cache clearing and removing / reinstalling involved. Even then some of them would randomly and inexplicably refuse to display the content, instead just showing @DOCUMENT NN

    If this sounds like you, grab the GetResourceField snippet and include the call to your resource in your templates. Works great.
    • FastField, or even better install pdoTools with the custom parser option. This will give you the custom MODX tags [[#docid.fieldname]], as well as faster listing snippets like pdoMenu and pdoResources that are virtually drop-in replacements for getResource, Wayfinder, etc.

      For example, pdoMenu can be configured to not waste its time checking for permissions in the case of a site that doesn't use them.
        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