"Global block"

Permalink
Hi,

First, I want to thank about great CMS. We have tested and worked with 15-20 different CMS (open source and commercial) and we’ll love C5.

We are creating Finnish Concrete5 site and have one problem.
We have footer that contains three content blocks (page type defaults). One of the blocks we have a “useful links” list.

My question’s is there anyway to make changes to this "useful links" block in a way that all the pages using this default content block would be automatically updated?

The whole site will have close to seventy pages. Thus using the scrapbook for this one would be quite repetitive work.

See attachment.

Hope we’ll get translated C5 to Finnish someday…

1 Attachment

Wertti
 
griebel replied on at Permalink Reply
griebel
A solution is:

http://www.concrete5.org/community/forums/customizing_c5...
/calling_a_specific_block_area_from_template#2634
Wertti replied on at Permalink Reply
Wertti
Tried to find solution from forum but didn’t found. :)
frz replied on at Permalink Reply
frz
You can also just use page defaults from dashboard to do this if u are the admin user

Also if you copy a block with scrapbook then edit the original, the changes should show up on every other instance u placed ( as long as you didn't make more edits to the copied inatance)
powermick replied on at Permalink Reply
powermick
Also if you copy a block with 
scrapbook then edit the original, the 
changes should show up on every other 
instance u placed ( as long as you didn't 
make more edits to the copied 
inatance)


i'm sorry frz but:
in C5 5.2RC2 is false, I tested!!
frz replied on at Permalink Reply
frz
Yeah I see what you mean.. Well this is how it worked previous to 5.2, my bet is its an issue with the caching stuff we introduced with 5.2 - although when i goto dashboard and reset the site cache I still don't see changes...

I think this is a bug.
andrew replied on at Permalink Reply
andrew
This is a little harder than it needs to be, but this should hopefully help.

Assuming this code is called on your home page as well as everywhere else, insert this everywhere the code is called

<?php
global $c;
if ($c->getCollectionID() == 1) {
    $a = new Area('Useful Links');
    $a->display($c);
} else {
    $pc = Page::getByID(1, 'ACTIVE');
    $a = new Area('Useful Links');
    $a->display($pc);
}
?>


Make sure you view the whole snippet and grab it. Basically this code snippet checks to see if you're on the home page. If you are, you get the regular useful links area, and you can add whatever block to it you like, edit it, etc..

If you're not, it grabs the current content from the useful links area on the home page and change it. So basically you only have to change it on the home page and then you're done. No messing around with the scrapbook or even with all the various page types in the dashboard.
admin replied on at Permalink Reply
Thanks Andrew - that one works perfectly!
andrew replied on at Permalink Reply
andrew
Just wanted to update: while I think the problem of this post has been solved, I wanted to weigh in on the copying of blocks and editing the original block making changes to the new instances.

I'm fairly certain that, if you copy a block to a second page, and then make changes to the original block, you will probably NOT see them propagated out.

The reason for this is as follows:

We make a block on a page, that block gets a unique numerical ID. We put the block in the scrapbook, and that ID is in the scrapbook.

Make a chance to the block on the page, if the page in question is active, we are ACTUALLY making a new block, and attaching it to a new version of the page. So if a particular item was bID 500, the new version of it (post edit) is 501 (or whatever.)

This means that the scrapbook still has 500 in it, and 500 is still the block aliased out to the rest of the site.

Now, whether this is ideal or not...it's hard to know, because of the way versions work. And I'm fairly certain that it's been that way for awhile. Master pages don't work this way because they aren't versioned - any time you edit a block on the master page you're just updating that existing bID.
synlag replied on at Permalink Reply
synlag
This is interesting to know.
I have another question on that.

How are Blocks positioned within an editable area?

When i add a block to the 'initial version' of a page in the defaults edit mode, it's always positioned at the bottom, if other blocks are already existing in this area.
matogertel replied on at Permalink Reply
matogertel
I was just thinking today that you should be able to add blocks to the scrapbook without them being on any page at all, and then be able to edit the blocks from the scrapbook itself. That way you would solve the problem of "Global Blocks" altogether.
TheServant replied on at Permalink Reply
Sounds like a good idea. Has there been any development with this? A global block would solve 99% of my problems with c5!
synlag replied on at Permalink Reply
synlag
Yes,
create a new scrapbook and some global blocks at dashboard->scrapbook
these are available when adding stuff to an area
makeway replied on at Permalink Reply
makeway
I'm not entirely sure if this thread addresses my issue (and one that I would assume most C5er's have). Here's a scenario to help explain:

I have utilized C5's awesome scrapbook and page defaults capabilities to add all the pages and their content to my site. After everything is added, I want to add 1 block to every page. A perfect example is the "Popup" block (http://www.concrete5.org/marketplace/addons/popup/).

Is there a way for me to easily add this block (or any other block) to all the pages on my website, other than adding the block manually to each page? Thanks.
Mnkras replied on at Permalink Best Answer Reply
Mnkras
go to page defaults add the block, click on it, and click apply to children (or something like that)
makeway replied on at Permalink Reply
makeway
Lifesaver! Thanks so much!