Design and CSS styles
Version 3.x > Design and CSS styles > Different graphics on different section of a site View modes: 
User avatar
Certified Developer 8
Certified Developer 8
d.rakopoulos-redirect - 9/23/2008 6:17:15 AM
   
Different graphics on different section of a site
Hello,

I have the following scenario. A site has different graphics on diffrent sections. So, how can I use a master template and then change it to various sections of the site since the other sections should have diffrent graphics on the layout.

For example: The home page has a header graphic a.jpg. I want the section products to have a header graphic B.jpg etc. Note that it's not just one graphic element but 3 or 4 of them. Should I use somehow inheritance? I ma really confused.

Thank you,
Dimitris

User avatar
Kentico Support
Kentico Support
kentico_radekm - 9/23/2008 8:20:04 AM
   
RE:Different graphics on different section of a site
Hello,

I am not sure, if you can change master's page content in dependance of sub-page loaded into this master page, but there is one alternative solution using visual inheritance feature.

I will demonstrate it on example: I have a site, which using some master page.
Then I have 2 sections: Audio and Video. Both includes some pages. Like here:

Root
-Audio
. Page 1
. Page 2
- Video
. Page 1
. Page 2

Now I want e.g. Audio and Video section to have the same template but with different image in footer. I do it with following steps:

1. If Audio and Video section uses same template, i make its copy and use for Audio original and for video copied template.
2. I insert "<div class="zoneFooter"> <cc1:CMSWebPartZone ID="zoneFooter" runat="server" /> </div>" into layout of both templates used on Audio and Video sections.
3. Into this webpartzone i insert General/Powered by Kentico webpart and in its properties change Content->Text to different URL (path to picture you want to use). By this way i can ensure different image in page footer in two different sections of my web.
4. I go to Audio and Video page's Properties -> Template and select "Do not inherit any content"

Or you can change layout of master page to have only webpart you do not want to change in particular categories. And requested webparts, you want to change, add when editing layout of particular section.

To more info about visual inheritance please read: http://devnet.kentico.com/docs/devguide/visual_inheritance.htm

Best Regards,
Radek Macalik