Heya guys,
My first site using Couch has been up for several months and I love it so far.
The client has decided he wants to expand the site to include different sections (pages) but wants to display a different logo image on each of these new pages.
The site is currently set up with globals.php & header.html (in snippets) as per the tutorial with the logo image in header.html pulled from globals.php.
My thoughts are to add to globals.php so the client can add/upload his image and then use an if/else statement in heater.html to display the required logo on the different pages.
My problem is I'm not sure of the best way to code the if/else into header.html
OR if there is a better way to achieve what I need.
Below is my globals.php (with new variables added) and my header.html (with new links added).....
globals.php
header.html
The 5 "Section Pages" in globals.php and the "Site Nav2" links in header.html are the relevant pages.
Any help appreciated, Cheers 8-)
My first site using Couch has been up for several months and I love it so far.
The client has decided he wants to expand the site to include different sections (pages) but wants to display a different logo image on each of these new pages.
The site is currently set up with globals.php & header.html (in snippets) as per the tutorial with the logo image in header.html pulled from globals.php.
My thoughts are to add to globals.php so the client can add/upload his image and then use an if/else statement in heater.html to display the required logo on the different pages.
My problem is I'm not sure of the best way to code the if/else into header.html
OR if there is a better way to achieve what I need.
Below is my globals.php (with new variables added) and my header.html (with new links added).....
globals.php
- Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Global Settings' executable='0' order='99'>
<cms:editable name='site_name' label='Your Site\'s name' type='text' order='-3' >Aurelius</cms:editable>
<cms:editable name='logo_image' label='Your Logo Image' desc='Upload you logo image here' type='image' order='-2' />
<cms:editable name='site_desc' label='Your Site\'s description' type='text' order='-1' />
<cms:editable name='home_caption' label='Home Caption'
height='50'
type='textarea' order='4'><p> </p>
</cms:editable>
<cms:editable name='about_caption' label='About Us Caption'
height='50'
type='textarea'> order='5'><p> </p>
</cms:editable>
<cms:editable name='gal_caption' label='Gallery Caption'
height='50'
type='textarea' order='8'><p> </p>
</cms:editable>
<cms:editable name='safety_caption' label='Safety Caption'
height='50'
type='textarea' order='6'><p> </p>
</cms:editable>
<cms:editable name='faq_caption' label='FAQ Caption'
height='50'
type='textarea' order='9'><p> </p>
</cms:editable>
<cms:editable name='contact_caption' label='Contact Us Caption'
height='50'
type='textarea' order='10'><p> </p>
</cms:editable>
<cms:editable name='dt_caption' label='Dog Tales Caption'
height='50'
type='textarea' order='11'><p> </p>
</cms:editable>
<cms:editable name='dts_caption' label='Dog Tales Submission Caption'
height='50'
type='textarea' order='12'><p> </p>
</cms:editable>
<!-- // Start Section Pages // -->
<cms:editable name='lm_caption' label='Lawn Maintenance Caption'
height='50'
type='textarea' order='13'><p> </p>
</cms:editable>
<cms:editable name='lm_logo_image' label='Your Lawn Maintenance Logo Image' desc='Upload you logo image here' type='image' order='14' />
<cms:editable name='hm_caption' label='Handymen Caption'
height='50'
type='textarea' order='15'><p> </p>
</cms:editable>
<cms:editable name='hm_logo_image' label='Your Handymen Logo Image' desc='Upload you logo image here' type='image' order='16' />
<cms:editable name='ls_caption' label='Landscaping Caption'
height='50'
type='textarea' order='17'><p> </p>
</cms:editable>
<cms:editable name='ls_logo_image' label='Your Landscaping Logo Image' desc='Upload you logo image here' type='image' order='18' />
<cms:editable name='fencing_caption' label='Fencing Caption'
height='50'
type='textarea' order='19'><p> </p>
</cms:editable>
<cms:editable name='fencing_logo_image' label='Your Fencing Logo Image' desc='Upload you logo image here' type='image' order='20' />
<cms:editable name='hire_caption' label='Equipment Hire Caption'
height='50'
type='textarea' order='21'><p> </p>
</cms:editable>
<cms:editable name='hire_logo_image' label='Your Hire Logo Image' desc='Upload you logo image here' type='image' order='22' />
</cms:template>
<?php COUCH::invoke(); ?>
header.html
- Code: Select all
<a href="<cms:link 'index.php' />"><img class="grid_logo" alt="Red Heeler Industries" src="<cms:get_custom_field 'logo_image' masterpage='globals.php' />" /></a>
<!-- /* Site Nav2 */ -->
<ul id="navigation" class="grid_9">
<li><a href="<cms:link 'hire.php' />" <cms:if k_template_name=='hire.php'>class="current"</cms:if> ><br />Hire</a></li>
<li><a href="<cms:link 'fencing.php' />" <cms:if k_template_name=='fencing.php'>class="current"</cms:if> ><br />Fencing</a></li>
<li><a href="<cms:link 'landscaping.php' />" <cms:if k_template_name=='landscaping.php'>class="current"</cms:if> ><br />Landscaping</a></li>
<li><a href="<cms:link 'handymen.php' />" <cms:if k_template_name=='handymen.php'>class="current"</cms:if> ><br />Handymen</a></li>
<li><a href="<cms:link 'lawn.php' />" <cms:if k_template_name=='lawn.php'>class="current"</cms:if> ><br />Lawn Maintenance</a></li>
<li><a href="<cms:link 'index.php' />" <cms:if k_template_name=='index.php'>class="current"</cms:if> ><br />Home</a></li>
</ul>
<!-- Navigation Menu -->
<ul id="nav2" class="grid_9">
<li><a href="<cms:link 'contact.php' />" <cms:if k_template_name=='contact.php'>class="current"</cms:if> ><br />Contact Us</a></li>
<li><a href="<cms:link 'faq.php' />" <cms:if k_template_name=='faq.php'>class="current"</cms:if> ><br />FAQ</a></li>
<li><a href="<cms:link 'gallery.php' />" <cms:if k_template_name=='gallery.php'>class="current"</cms:if> ><br />Gallery</a></li>
<li><a href="<cms:link 'safety.php' />" <cms:if k_template_name=='safety.php'>class="current"</cms:if> ><br />Safety</a></li>
<li><a href="<cms:link 'about.php' />" <cms:if k_template_name=='about.php'>class="current"</cms:if> ><br />About Us</a></li>
<li><a href="<cms:link 'dogtales.php' />" <cms:if k_template_name=='dogtales.php'>class="current"</cms:if> ><br />Dog Tales</a></li>
</ul>
The 5 "Section Pages" in globals.php and the "Site Nav2" links in header.html are the relevant pages.
Any help appreciated, Cheers 8-)