0

What's the simplest* way to enable non-technical writers, editors etc to edit the text in Views headers, titles, footers etc, without needing to enable Views UI on a production site, train these non-technical staff to use some of it, and grant them Views UI permissions?


It's common for content staff - writers etc - to have nothing to do with site building tools like Views UI. It's not their remit or expertise. Also, they'll usually be editting content on the production site, while site builder UI tools like Views UI are often disabled on production sites to reduce unnecessary memory consumption (less PHP files to parse for hooks).

But, the text content of the title fields, view headers, etc is within their remit and expertise. What's the simplest way to bring these text snippets - but not the whole Views UI - within their reach?

*Here, 'simplest' means minimal extra modules, minimal complexity in workflow, minimal overheads) Options using Panels are fine in my case. Ideally, I'd prefer to avoid needing to use Display Suite.


The workaround I'm using at the moment, which just about works (but I'm sure there's a simpler way) is this:

  • I have a custom taxonomy vocabulary, 'Text Snippets'
  • Each Text Snippet has a name describing to editors where in the interface it is used
  • Each Text Snippet description contains the HTML to be used
  • The views' headers are set to 'Render entity' with the ID of the appropriate Text Snippet term written in
  • To stop the internal-use-only term name being displayed, I have a custom template in my theme templates folder, taxonomy-term--text_snippets.tpl.php, containing nothing but <?php print preg_replace("/<p[^>]*>[\s|&nbsp;]*<\/p>/", '', $description ); ?> (the preg_replace regex removes empty paragraphs)

I'm aware of a module, Snippets, which seems to have a similar idea, but it's not at all clear what the intended usage is, there's very little information - blank readme file, documentation is only placeholders - and the very low usage stats and queue history don't fill me with confidence.

2 Answers 2

3

You can use the Views UI: Edit Basic Settings module:

"Views UI: Edit Basic Settings" places edit tabs on Views pages, similar to node pages, and allows users with the correct permission to modify their header, footer, title, empty text, or number of items to display. This module also provides a separate interface that displays a list of views. All Views are defined by you, so you can exclude certain Views.

1

Make a Taxonomy Vocabulary "Views Title", add terms. Each term represents a 'view'. Taxonomy is entity, so it is field-able. For example, you can use the description field as View's Header; Term name as view's title.

Assign permission to manage "Views Title" Taxonomy for your editor.

Within you module, use "hook_views_pre_render", alter the view title/header to be term's name/description.

2
  • Pretty much the same as the workaround I'm currently doing that I described in the question - good to know I'm not the only one to think that's a good approach though. Nov 19, 2012 at 16:29
  • perhaps, use a "helper" content type.
    – gilzero
    Nov 20, 2012 at 1:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.