Improvements to Global Content Blocks

Talk about new features for CMSMS and modules.
Locked
gocreative
Power Poster
Power Poster
Posts: 265
Joined: Mon Mar 14, 2011 1:16 am
Location: Brisbane, Australia

Improvements to Global Content Blocks

Post by gocreative »

I have a few suggestions to improve Global Content Blocks:

1) Add an extra field for 'Name', with the current 'name' field being changed to 'alias' (since that's really what it is). This field could then be used to display a more friendly title when loading a list of GCBs, such as allowing the editor to choose which GCBs to display on the current page.

If it's difficult to change the current field for compatibility reasons then adding a new field titled 'Friendly Name' would work too.

2) Add a checkbox for 'Literal' which automatically wraps the entire block in {literal} tags (just a nice handy shortcut for things such as inserting Google Analytics code or other scripts).

3) Allow folders for better sorting/grouping (similar to the Pages hierarchy list). I realise this has been raised before, but I'm just giving it a +1. Additionally it would be good if a permission could be set per folder (from the GCB page) which automatically applies to all items within that folder, unless specified otherwise. This would really help when several GCBs need their permissions changed, especially if drag-and-drop was available to move them into folders.

4) Allow sorting and filtering of the GCB list.

5) Allow multiple GCBs to be listed in one call, in the specified order, such as:

{global_content name='gcb_alias1,gcb_alias2'}

This would avoid the need to include one GCB inside another and reduce template/page code while keeping the current level of flexibility.

6) Allow an ID and/or multiple Classes to be applied to a GCB, which wraps the entire element in a DIV. This would be called as follows:

{global_content class='sidebox,float_right' id='news_list'}

This would produce:

<div id="news_list" class="sidebox float_right">
(the contents of the GCB here)
</div>

The benefit of this is that clients can edit GCBs without the potential to screw up any specific CSS (assuming they use the WYSIWYG editor). I often need to apply specific styles to individual GCBs but don't trust the client with it so I don't give them access, even though the contents of the GCB might be something fairly simple like an unordered list or paragraph.
User avatar
Reanimator
Forum Members
Forum Members
Posts: 14
Joined: Tue Jul 09, 2013 9:12 am

Re: Improvements to Global Content Blocks

Post by Reanimator »

I largely agree with you!
For this reason, I wrote a module that replicates the functionality of global content blocks, but it is expanded. The module is called "Sections". (http://dev.cmsmadesimple.org/projects/sections)

You can put a section in the template and in the settings of section you can select the pages on which this section will be displayed. You can also select the amount of dates on which this section will be displayed.

I also plan to improve the functionality. Create the ability to group sections, search, etc. I also take a note your comments.
gocreative
Power Poster
Power Poster
Posts: 265
Joined: Mon Mar 14, 2011 1:16 am
Location: Brisbane, Australia

Re: Improvements to Global Content Blocks

Post by gocreative »

My current solution is to use ListItExtended. I use a ContentPages field as a multi-select which allows clients to choose which page(s) to show their content on. This offers a pretty good level of flexibility, but your module sounds like it might do the same job with less overheads/complexity than what I'm doing.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Improvements to Global Content Blocks

Post by calguy1000 »

A 'GCB' or 'HTML Snippet' is just a smarty template.

In 2.0 the design manager integrates Page templates, module templates, etc. and organizes them based on template 'type' (A GCB will be a generic, core template), 'category', and 'design'. All of the associations are optional.

Note, I said 'category'. You can create categories, and associate any template with a category. You can then list all of the templates of a certain type, or category, or design.

Design Manager adds a 'description' to each template.

Design Manager uses the same 'owner and additional editor' mechanism that content pages use, to restrict access.

With smarty3 literal tags aren't required any where near as much as before. If you don't want smarty processing the { and the } just use whitespace.

Code: Select all

{smarty_tag}  { not smarty tag }
Because templates can be used for many different things (including javascript, html snippets, etc). They can produce json, html, csv, or even pdf output, and can be used to generate inline code (such as a link) or block code (such as a div) there will be no design level elements added (like a class or id parameter, or automatically adding literal tags etc. Though somebody could easily write a tag that does.

With template inheritance in smarty3 there should be very little need to nest one GCB inside another (and besides, if that's what you need you should do it.... having a list of them to call in order implies that the order of them is arbitrary, and/or optional.

Hope this helps.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
gocreative
Power Poster
Power Poster
Posts: 265
Joined: Mon Mar 14, 2011 1:16 am
Location: Brisbane, Australia

Re: Improvements to Global Content Blocks

Post by gocreative »

Thanks for the advice. My original post was quite old and well before the announcements regarding CMSMS 2.0. Good to hear some/most of these points are covered in a future release.
Locked

Return to “Feature ideas”