How to Mirror Content?

Permalink
I am trying to figure out how to implement a calendar - a list of important dates - on our website. The requirements for this "calendar" are very slim: it is simply a text list:

Sep 28: Soccer Tournament
Oct 17: IDP Registration
Oct 23: IDP Placement Test
... and so on.

My question is: how can I mirror this content on various pages of my website (in my case the "home" and "events" pages.)

I would like for the content administrators to only have to change it in one of the instances (say "events" page) and the content is updated in other parts of the website automatically. Is that possible?

Michael

 
ScottC replied on at Permalink Reply
ScottC
This has been a question of mine as well. I have a friend that has a vacation rental and I want to plaster his calendar in every page, but I am not sure if it is possible to include this in a page using a block, or if I need to do a new page type with the calendar in it that I edit back from the administration side of things with a single page.

I guess with the correct controller and edit page one could select a row that is already in the db table and use that, but I will let others hopefully answer this better than I can :)
macgillivary replied on at Permalink Reply
macgillivary
I believe you edit the defaults for the page type. You may need to create a block first, which can later be added as the default for a page. Then each page you base from the page type will have the calendar.

Dashboard -> Page Types -> Defaults

What I'm not sure about is how to apply the calendar to all pages which are already based on that page type. Seems to work on a go-forward bases, but not retroactively. Its likely possible, I just don't see how to do it. I'm looking for the "Apply/Add to existing pages of this type"
ScottC replied on at Permalink Reply
ScottC
This does work well, didn't get that far into the cms.

I believe when the page is saved as a child of that page type it is adding the blocks that are currently in the page type their blockID and their positions. I think this is a feature request, and a pretty good one.
andrew replied on at Permalink Reply
andrew
The same place in "defaults" where you add the new block...once you've added it, click on the block as it appears, and you should see a special option you only see while working on the defaults page... "Setup on Child Pages"

This should show all pages of this type, along with check boxes that will allow you to alias out the new block to existing pages...
mikefats replied on at Permalink Reply
Thanks for your replies, everyone.
The editing of a "Page Type" to update the calendar would definitely do the trick.

I've tried out the process of making an update that way, and although it works, it is a little complicated for people who manage the content: enter dashboard > pick the right template > update calendar block content > remember to set up on child pages before saving. Also, I would like to have the calendar content appear in a narrow column on the "Home" page, but give it more horizontal space and different formatting on the "Calendar" page.

I was thinking that since the "content block's" content (on the calendar page) is written into the database, it would be possible to hardcode a statement (on the home page) to pull its content in (and wrap it in CSS tags so that it gives me flexibility in formatting it.)

That way, the content administrators of our website wouldn't need to worry or learn about our templating system and the content can be formatted/styled in various ways on different pages.

Is there such a code that would pull out content from an existing "content block"?
mikefats replied on at Permalink Reply
In C5 we currently have content blocks that are:
- one-offs: used on one page
- exact replicas: used on several pages when built into a "page type"

Now, my PHP skills are pretty basic and I would appreciate any pointers: how does one go about reading out contents from the database using PHP code (and C5's classes)?

The PHP code will then be used on page types. The way I see it, that kind of a setup has two benefits:
1. makes it possible to use in various parts of the website while enabling me to format the (same) content in different ways if necessary, and
2. is easy and intuitive for site contributors to edit (just like your standard content block).
Remo replied on at Permalink Reply
Remo
What about this:
http://www.concrete5.org/community/forums/customizing_c5/one_single...

Would my idea be useful for you?
mikefats replied on at Permalink Reply
Most definitely.
I have, in fact, set an alert for that thread some time ago, so what has been discussed there that is exactly what I've been looking for.

Thanks Remo
ScottC replied on at Permalink Reply
ScottC
Just tried this, worked great.

Thank you Andrew.
Styves replied on at Permalink Reply
Styves
But HOW? Explain please.
macgillivary replied on at Permalink Reply
macgillivary
perfect - figured it was tucked in there somewhere.