I am using CMSMS version 10.1.1 and a commercial template with 4 pages. The website is here: http://ghdesigns.peppermgmt.com/.
The way it was coded the header and footer is the same but the content divs are all unique like this:
</__body>
<div id="wrapper">
<div id="contentWrapper">
<div id="header">
</div><!-- end of header -->
[color=#FF0000] <div id="mainHome">[/color] (This is the content div that changes depending on which page layout is desired)
<ul id="menuTab">
</ul><!-- end of menuTab -->
html code...
</div><!-- end of mainHome -->
<div class="clear"> </div>
</div><!-- end of contentWrapper -->
<div id="footer">
</div><!-- end of footer -->
</div><!-- end of wrapper -->
<__body>
On each page div mainhome changes to mainwork etc. These are the divs that hold the main content with their own background images etc. Different on each page. Is there any way to activate the content area divs depending on what kind of page is being created?
Such as if mainhome is the home page content but I need to create a portfolio page which is in the mainwork div, is the only way to do this is to create a different template for each? Is there a way to select one of the four content layouts when the page is created?
I am just trying to make it easy for my client to update and add new pages.
Thanks
dynamic changes to content layout.
Re: dynamic changes to content layout.
I dont understand what you are asking. Basically if you have 4 templates, a user will be able to select any of the active templates, when adding/editing a page. So if you have a default user, select template in the BasicProperties in GlobalSettings, and the template will be visible on the main-tab of add/edit page. He can then select which template is applicable to that specific page.
Ronny
Ronny
Re: dynamic changes to content layout.
Besides,
if the styling of the page is dependant on the section of the site, you can steer that in a single template then as well.
If you have f.e.
home
products
- a
- b
something else
then it would be possible to tell at 'b', that the same logic is applicable then for products. So if logic is possible, I would use it, otherwise let the customer pick the correct template.
Ronny
if the styling of the page is dependant on the section of the site, you can steer that in a single template then as well.
If you have f.e.
home
products
- a
- b
something else
then it would be possible to tell at 'b', that the same logic is applicable then for products. So if logic is possible, I would use it, otherwise let the customer pick the correct template.
Ronny
Re: dynamic changes to content layout.
As far i understand (except for home other pages can not be reached) you want to change the ID of that div depending on current page.
Waht you need is:
Also for spot id:
This will give you id with alias of current page for home that would be "main-home" and "spot-home".
Now open your stylesheet and change #mainHome to #main-home and #spotHome to #spot-home and that style will be applied to your "home" page.
You should be able to figure out now what to do for "about" and so on.
Waht you need is:
Code: Select all
<div id="main-{$page_alias}">
Code: Select all
<div id="spot-{$page_alias}">
Now open your stylesheet and change #mainHome to #main-home and #spotHome to #spot-home and that style will be applied to your "home" page.
You should be able to figure out now what to do for "about" and so on.
Re: dynamic changes to content layout.
Thanks for your prompt response.uniqu3 wrote:As far i understand (except for home other pages can not be reached) you want to change the ID of that div depending on current page.
Waht you need is:Also for spot id:Code: Select all
<div id="main-{$page_alias}">
This will give you id with alias of current page for home that would be "main-home" and "spot-home".Code: Select all
<div id="spot-{$page_alias}">
Now open your stylesheet and change #mainHome to #main-home and #spotHome to #spot-home and that style will be applied to your "home" page.
You should be able to figure out now what to do for "about" and so on.
I think you have the basic idea. My challenge is that I wont know what the page alias will be if I am not the one creating new pages. The content layout is totally different on each page.
I understand that I may just have to create 4 templates. I was just checking to see if there was an easier way to achieve the switching.
Thanks
Re: dynamic changes to content layout.
Well you can still create a content block {content block='my_id' label='Enter style id like "mainHome". <span style="color:#f00;">Only possible values: mainHome, mainAbout AND SO ON</span>' assign='my_id' oneline='true' size='80'}
Then you would have additional input field when editing pages,
With assign you have a variable $my_id so you would use it:
Then you would have additional input field when editing pages,
With assign you have a variable $my_id so you would use it:
Code: Select all
{content block='my_id' label='Enter style id like "mainHome". <span style="color:#f00;">Only possible values: mainHome, mainAbout</span>' assign='my_id' oneline='true' size='80'}
<div id="{if !empty($my_id)}{$my_id}{else}MyCommonID">
Re: dynamic changes to content layout.
That is a great idea! I think it may work for me. I am not too good at variables and such just yet but I will give it a go.
I may have an additional question or two but I will let you know.
Thank you so much.
I may have an additional question or two but I will let you know.
Thank you so much.