Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
One page - same layout
03-07-2011, 10:10 AM
Post: #1
One page - same layout
Hello everyone.

First of all thank you for releasing this great cms to the public.

Now to my question:
I want to create a homepage with several subpages.
My problem is that all of the subpages should use the same layout.
I created the main index page, and added (then activated) the layout.

Then I added more pages using the file explorer.

Now I want to modify the layout on every page at the same time,
but If I go to the second page I need to add a completely different layout.

My current problem is that if I modify the layout afterwards, the updates are only visible in one page, not at every page at the same time.

How can I modify a layout "Globally" ?

Thank you, Louis
Ah, I found out how this is done.
You just add a layout widget to the second page, and all avaialable layout who where already added on another page can be activated.

Thank you, Louis
Quote this message in a reply
03-08-2011, 08:01 AM
Post: #2
RE: One page - same layout
Reusing an existing layout is easy - just activate it after dropping a Layout widget onto the page. Which you appear to have discovered on your own. It does involve a couple extra seemingly unnecessary clicks for most sites but it would be a huge pain in the neck to work around if a custom design was needed for just one or two pages if the widget wasn't built this way.

A couple of extra tidbits of info:

The Layout widget keeps track of all available layouts in the system. You can also build layouts such that they can be hot-swapped for a specific page. Say, for instance, you want a St. Patrick's Day theme for just the homepage. You can build a new layout with placeholders with the same names for master widgets and then apply that new layout to the homepage and the Layout widget looks for matches to the names of placeholders and then attaches the correct master widget to the correct placeholder. Then, when the holiday or season is over, apply the old layout and the homepage goes back to normal. If you want to affect the entire site, then I recommend cloning the old layout first and then overwrite the existing files with the new layout. Changes to a layout affect all pages using that layout. If you do hot-swapping of layouts, I recommend setting up a test page where you can try out the new layout without affecting the main site.

There is a file in the root called lastupdated.php that contains a timestamp of the last global update. When this file is changed, the caching system notices that the cached files it has are older than the global site timestamp and therefore knows it needs to regenerate the page. The Layout widget automatically does this. It is useful to know how the caching system knows when to push updates out to all pages.

Author of Barebones CMS

If you found my reply to be helpful, be sure to donate!
All funding goes toward future product development.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

© CubicleSoft