I’m building a template for a local non-profit organization. The body pages follow a fairly standard ’header, two columns, footer’ design paradigm, but the front page has a number of text areas that I’d like to enable people from the non-profit to edit without touching the code that defines them. Ideally, when logged into the manager, the end-user ought to see "edit this" buttons for each text area that opens the contents up the WYSIWIG editor, similar to the editor for the large text areas in certain pages of the ModX demo site.
I know I could use @file to load in a file, and have the users edit that manually and FTP it up, but the simpler I can keep this, and the less code they have to write, the happier they will be..
Can I do this without custom rolling? I know its sort of a simple question, but skimming the docs didn’t show me anything utterly obvious, except possibly TVs, if I’m understanding them correctly, which I may not be..
-
☆ A M B ☆
- 24,524 Posts
That’s what TVs (Template Variables) are for.
Make a new Template for the home page (you can simply duplicate your main template and name it something else). Do this so the TVs won’t be showing up for editing for all the documents in the site! Then create a TV for each area, and assign it to the home page template you just created.
Each area would have its own TV, with the input type set to "rich text". Then in your home page template, use [*#tvName*] for each section, and there will be a QuickEdit button for editing each one on the front-end; or they can all be edited from the document editing panel of the Manager.
You are not required to use the [*content*] tag at all if it isn’t appropriate to the page. There is even a plugin for hiding that big "Document content" editing area if you don’t want it to show.