I miss the old Global Content Blocks

General project discussion. NOT for help questions.
Locked
urheat
Forum Members
Forum Members
Posts: 243
Joined: Sat Oct 17, 2009 6:50 am
Location: Finland

I miss the old Global Content Blocks

Post by urheat »

I've been using CMS Made Simple for years and it's still the number one CMS for me.

Mostly CMSMS 2 is great but I really miss the old way of creating and using GCBs.

It was really easy to create and find the global content blocks (The Design Manager is easily quite a mess even in small sites).

And maybe the biggest thing is that it was easy for a person who is updating the content to understand the concept. But now... And do I really want non-technical person to have an access to the templates...?

I think there is a way to make Global Content Block editable using wysiwyg-editor (if it is, could someone link to the tutorial/documentation/discussion), but I assume that then the block is found from the page section, which I don't find so logical.

I'm pretty sure that I'm not the only developer that prefers the old CBS's. So maybe you could consider an alternative way someday. Thanks.
spcherub
Power Poster
Power Poster
Posts: 402
Joined: Fri Jun 06, 2008 5:54 pm

Re: I miss the old Global Content Blocks

Post by spcherub »

I had similar concerns and asked about this earlier on the forum. Here is a quick summary of the recommendations:
- Create a generic template and add one content block for each GCB you will need. Make sure to give each block a unique name.
- Create a page using this new template (make sure it does not show up in navigation)
- Where you need to, use the page_attr tag to pull content in from a specific block on this special page.

If you set things up this way, the editor can update the content in a GCB without needing access to the template/design section.

Hope this makes sense.

S
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3479
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: I miss the old Global Content Blocks

Post by velden »

Let me show you a real world example :)

I created a template of type Core::Page named 'Global Settings'

Code: Select all

{content assign='dummy' label='1e kolom footer'}
{content block='footer_column_2' assign='dummy' label='2e kolom footer'}
{content block='footer_column_3' assign='dummy' label='3e kolom footer'}
{content block='footer_mobile_1' assign='dummy' label='Mobile footer'}
{content_image block='page_image' dir='images/pageimage' assign='dummy' urlonly=1 label='Ronde afbeelding rechter kolom' exclude='thumb_'}
Then I created a new Content Page and set it up to use this 'Global Settings' page template, hide this page from the menu. Alias for this page is 'gs'. I gave the page a title/menu text which makes sense for editors: 'Global Content' (note the page isn't shown on frontpage but menu text is shown in Content Manager).

Then in other page templates where you want to use the 'Global Content':

Code: Select all

...
        <div class="three-column sidebar">
          <div>{page_attr page=gs key="page_image" assign=page_image}{if $page_image != '' && $page_image != -1}{CGSmartImage src1='images/pageimage' src2=$page_image filter_croptofit='400,400' noembed=1 class='round'}{/if}</div>
...
      <div class="section footer-desktop">
        <div class="three-column">{eval var={page_attr page=gs key="_dflt_"}}</div> 
        <div class="three-column">{eval var={page_attr page=gs key="footer_column_2"}}</div> 
        <div class="three-column">{eval var={page_attr page=gs key="footer_column_3"}}</div> 
      </div>
      <div class="section footer-mobile">
        <div class="one-column">{eval var={page_attr page=gs key="footer_mobile_1"}}</div>  
      </div>
...
Note that at this time for page_attr to work the specific page has to be 'active'. But as per my request in next versions of CMSMS there will be a parameter to allow for inactive pages too. So then you can inactivate the global settings page so it will be impossible to 'call' the page on frontend even if one knows/guesses the alias (not a biggy but better IMO).

Of course you can use other content block types in your template as you like. And make use of the 'tab' parameter to group specific content blocks together in one tab (for editors).
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3479
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: I miss the old Global Content Blocks

Post by velden »

If you're willing to install a third party module you could consider having a look at Custom Global Settings module as another way to mimic Global Content Blocks behavior.

http://dev.cmsmadesimple.org/projects/customgs
User avatar
Rolf
Dev Team Member
Dev Team Member
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: I miss the old Global Content Blocks

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
kolivansemen
New Member
New Member
Posts: 1
Joined: Sat May 28, 2016 12:45 pm

Re: I miss the old Global Content Blocks

Post by kolivansemen »

Thank you! :)
applejack
Power Poster
Power Poster
Posts: 1015
Joined: Fri Mar 30, 2007 2:28 am
Location: London

Re: I miss the old Global Content Blocks

Post by applejack »

Getting rid of GCB was a stupid idea. Why:-

1. Easy for a client to use, as they create a GCB save and the code they need to use is shown which they can copy and paste.
2. Restrict access to templates for clients.
3. Randomise CGB based upon a naming convention (using regex), which I'm sure can be done now (not tried yet) but not as easily.
4. Ongoing compatibility with 1 series. I have some sites where I have more than 150 GCB which would be a real pain to convert.

Some connection with above but also somewhat of a tangent.

What would be really nice would be to have say a Listit2 type instance record(s) which could then be called within a page template as say a drop down select box. I have done similar using ECB + a UDT but only page specific not universal.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3479
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: I miss the old Global Content Blocks

Post by velden »

I tend to disagree with you on this one:

1,2 and 3: this all could have been done with a module like LI2 (Now LISE) and optionally combined with a UDT and a module like CGContentUtils

Regarding the copy/paste-able code (I assume the Smarty tag with parameters): think that could easily be made with a custom admin template (module_custom). That said, I'd wonder if editors should be using Smarty tags at all.

IMO your 4th argument is an implication of choosing a less ideal method in the first place.
lise_gcb01.PNG
lise_gcb02.PNG.jpg
lise_gcb03.PNG
lise_gcb03.PNG (10.13 KiB) Viewed 6917 times
lise_gcb04.PNG
applejack
Power Poster
Power Poster
Posts: 1015
Joined: Fri Mar 30, 2007 2:28 am
Location: London

Re: I miss the old Global Content Blocks

Post by applejack »

Yes exactly if you use modules which have a tendency to come and go which is why I try and stick to using the core as much as possible.

Re point 4 I meant in order to be able to update to series 2.
spcherub
Power Poster
Power Poster
Posts: 402
Joined: Fri Jun 06, 2008 5:54 pm

Re: I miss the old Global Content Blocks

Post by spcherub »

I agree that in many cases it is better to stick to "core" as much as possible. In my case, I see two possibilities:

1. Use the Page:Generic approach outlined earlier in this post. It is completely based on core capabilities and not likely to change significantly in the near-to-middle term.

2. Use CGSharedContent (http://dev.cmsmadesimple.org/projects/cgsc). Given that Calguy is one of the principal architects of CMSMS, it is more likely that this module will continue to be stable and supported in future releases.

-Sanjay
urheat
Forum Members
Forum Members
Posts: 243
Joined: Sat Oct 17, 2009 6:50 am
Location: Finland

Re: I miss the old Global Content Blocks

Post by urheat »

Just stumbled into another alternative: http://dev.cmsmadesimple.org/projects/gcb

Though this one is still in progress.
Locked

Return to “General Discussion”