Q's regarding page type defaults

Permalink
I'm just kicking off my use of Concrete5 and I've done some searching and I'm still a little boggled on this.

I am a "learn by doing" kind of person and have been referencing the documentation. I have a sample theme I threw together to experiment with. I've worked in other CMS but this one is quite unique compared to anything I've worked in.

In regards to page type defaults I've determined that any changes I make to the default will not occur on any pages that already exist in that page type. Only NEWLY created pages with that page type will reflect those changes.

Now, taking a menu for example... let's say a month down the road I want to change how the menu is sorted. Well if I've added that menu to the page type default and I go to try and change it now in the default, nothing will happen to existing pages using that type. I'd have to go in and change each one individually on every page which is a huge headache.

Instead (and here is where I'm looking for some confirmation) I would create a scrapbook of the menu and drop that into the page type default. Then a month down the road when I want to change how it's sorted or something I can change it in the scrapbook and THAT will cause it to change sitewide on any page types that use that scrap book clip in the default.

Or am I looking at this all wrong?

SpatialAnomaly
 
12345j replied on at Permalink Best Answer Reply
12345j
yes. also take a look at this post
http://www.concrete5.org/community/forums/usage/a-new-approach-to-a...
it has a pretty cool technique (but its not perfect)
jordanlev replied on at Permalink Reply
jordanlev
Hi,
I feel your pain (I was the one who wrote the long-winded post that 12345j refers to above).

But I think in your situation there is a better solution (if I'm understanding you correctly). What you need to do is make sure the blocks that you've added (for example, the autonav) are added FROM the page defaults page. This will require you to re-do the autonav block on a bunch of pages, BUT you only need to do this one time. After you've gone through and replaced them all (by deleting them individually from each page, then going to Page Defaults and adding the block there and then clicking on it and choosing "Setup on Child Pages" and checking all the boxes), you won't need to do that anymore -- from now on just make sure that you go to the Page Defaults to edit that autonav (if you edit it on an individual page, it will become "disconnected" from the page defaults and will not propogate to other pages it's on). And of course you'll have to repeat this for every page type since page defaults are per-page-type.

Super confusing, I know.

Another alternative is to hard-code the block into your template itself (there are tons of forum posts about how to do this -- search for "hard-code autonav" for examples). When you want to change it, you'll have to go into the code to do so, but at least you'll only have to change it once :)

Hope this helps. If I've just totally confused things, let me know and I'd be happy to spend a little more time to write more coherently.

-Jordan
SpatialAnomaly replied on at Permalink Reply
SpatialAnomaly
I'm actually playing around with the idea of just hard coding the scrapbook blocks using:
$block = Block::getByName('My Scrapbook Item');
$block->display();


It's working very well so far and allows me to change menu sort details and other such stuff that update globally.
jordanlev replied on at Permalink Reply
jordanlev
Ah yes, this is a good solution for many situations (watch out for related block assets such as css and js files though -- currently there is a bug in C5 which causes those things not to be loaded properly when using this technique).