Page 1 of 1

Inserting a page's content into a GCB?

Posted: Fri Apr 10, 2015 5:00 am
by rbaby
I would like to have the content of a Global Content Block to be editable via the pages so users with "Editor" permission can update the copy without needing access to the Global Content Block and possibly breaking the display inadvertently.

Is there a way to do this? I initially thought that the "assign" property for {content} would do this, but it did not so I guess I misunderstood how that actually works.

Any guidance would be really appreciated.

Re: Inserting a page's content into a GCB?

Posted: Fri Apr 10, 2015 11:27 am
by velden
Not sure what you want exactly: A GCB is ment to enter 'content' once for use on many pages. You can't edit it from a page, only from the GCB section itself.

Perhaps, but I don't know the possible disadvantages of this approach, you could consider using a separate page, and page template.

Give the page template a content blocks for every part you want the editor to be able to fill something in. Create a new page, hidden from the menu (maybe it's even allowed to disable it, just test it) and attach the new page template to it.

Then use the CGSimpleSmarty module's method 'get_page_content' to get the 'values' for the different content blocks of that page. Use those in your GCB or other page template(s).

Nice thing is that combined with e.g. the ECB module you can create some nice content blocks, like color picker, checkboxes, dropdowns etc. etc.

By the way: not sure why the editor could break the display. You might want to separate the content in the GCB's from the 'display' in the page template(s).
Read about template inheritance

Re: Inserting a page's content into a GCB?

Posted: Fri Apr 10, 2015 6:09 pm
by rbaby
Thank you velden for your response! I will try what you suggested.

The reason why I like to protect my GCB is because I usually put the entire container there as well so I can call it in anywhere as a whole. A lot of our editors are really really novice and they will likely delete a div here or there, even simple UDT tags are a bit complex for them.

Open to other suggestions as well.