Page 1 of 1

I miss the old Global Content Blocks

Posted: Mon May 23, 2016 3:03 pm
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.

Re: I miss the old Global Content Blocks

Posted: Mon May 23, 2016 6:06 pm
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

Re: I miss the old Global Content Blocks

Posted: Tue May 24, 2016 7:45 am
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).

Re: I miss the old Global Content Blocks

Posted: Tue May 24, 2016 7:47 am
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

Re: I miss the old Global Content Blocks

Posted: Tue May 24, 2016 8:01 am
by Rolf

Re: I miss the old Global Content Blocks

Posted: Sat May 28, 2016 12:47 pm
by kolivansemen
Thank you! :)

Re: I miss the old Global Content Blocks

Posted: Thu Jun 02, 2016 2:20 am
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.

Re: I miss the old Global Content Blocks

Posted: Fri Jun 03, 2016 11:32 am
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 7037 times
lise_gcb04.PNG

Re: I miss the old Global Content Blocks

Posted: Fri Jun 03, 2016 6:46 pm
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.

Re: I miss the old Global Content Blocks

Posted: Fri Jun 03, 2016 6:52 pm
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

Re: I miss the old Global Content Blocks

Posted: Thu Aug 18, 2016 6:39 am
by urheat
Just stumbled into another alternative: http://dev.cmsmadesimple.org/projects/gcb

Though this one is still in progress.