by
potato » Tue Apr 03, 2012 1:21 pm
hello again, thanks for your replies, sorry for the rather inadequate information, I think I was feeling a bit frazzled with it at that stage. The site is not live yet - am working on localhost - so I'll have to explain in a bit more detail ...
I have a main menu which includes a link = CONCERTS. CONCERTS is the only page on the site with sub navigation. There is no drop down navigation - it is a simple vertical list of 7 concert dates shown on each of the 7 concert cloned pages.
So to keep things as simple as possible (for me) I chose to go down the cloned pages routes (rather than nested pages/menu maker). I created a template - concerts.php (copied at the bottom of this post) and generated 7 cloned pages from this. I am not interested in the LIST view of the concerts.php page - since clicking on the main menu link CONCERTS will take you to the first cloned page. There is nothing to go on the listing page.
I am embedding the main_nav.html snippet as follows:
- Code: Select all
<ul>
<li><a href="<cms:link 'index.php' />"<cms:if k_template_name=='index.php'> class="current"</cms:if>>Welcome</a></li>
<cms:pages masterpage='concerts.php' limit='1' orderby='concert_no' order='asc' >
<li><a href="<cms:show k_page_link />"<cms:if k_template_name=='concerts.php'> class="current"</cms:if>>Concerts</a></li>
</cms:pages>
<li><a href="<cms:link 'artists.php' />"<cms:if k_template_name=='artists.php'> class="current"</cms:if>>Artists</a></li>
<li><a href="<cms:link 'venues.php' />"<cms:if k_template_name=='venues.php'> class="current"</cms:if>>Venues</a></li>
<li><a href="<cms:link 'tickets.php' />"<cms:if k_template_name=='tickets.php'> class="current"</cms:if>>Tickets</a></li>
<li><a href="<cms:link 'support-the-festival.php' />"<cms:if k_template_name=='support-the-festival.php'> class="current"</cms:if>>Support us</a></li>
<li><a href="<cms:link 'directions.php' />"<cms:if k_template_name=='directions.php'> class="current"</cms:if>>Directions</a></li>
<li><a href="<cms:link 'your-visit.php' />"<cms:if k_template_name=='your-visit.php'> class="current"</cms:if>>Your visit</a></li>
<li><a href="<cms:link 'contact.php' />"<cms:if k_template_name=='contact.php'> class="current"</cms:if>>Contact</a></li>
</ul>
This is functioning correctly in that clicking the main CONCERTS link takes you to the first cloned concerts.php page. And the sub-navigation is working OK too (thanks to Cheesypoof).
BUT the main nav link CONCERTS is permanently set as current link (along with the other page link e.g. on the home page both HOME and CONCERTS are 'current').
I guess that I can set the concerts.php template to executable=0 so that if a user tries to access it they'll get a 404 error.
I'm keen to crack this as I think it'll provide the basis for quite a lot of sites I do - fairly simple with no real need for complex nested lists for navigation purposes.
Am really very grateful for your help!
concerts.php
- Code: Select all
<?php require_once( 'hhcmf/cms.php' ); ?>
<cms:template title='Concerts Page' clonable='1' commentable='0' order='15' >
<cms:editable name="concert_no" label='Concert Number (for ordering in navigation)' type='text' order='5'/>
<cms:editable name="concert_date_time" label='Concert date and time' type='text' order='10'/>
<cms:editable name="concert_venue" label='Concert venue' type='text' order='15'/>
<cms:editable name="featured_artist" label='Artist performing' type='text' order='20'/>
<cms:editable name="artist_extra" label='Artist extra info' type='textarea' order='25'/>
<cms:editable name="concert_programme" label='Concert programme' type='textarea' order='30'/>
<cms:editable name="concert_details" label='Concert details (e.g. like Bows and Arias)' type='richtext' order='35'/>
<cms:editable name="ticket_info" label='Ticket info' type='text' order='40'/>
<cms:editable name="ticket_info_supplementary" label='Ticket info supplementary' type='text' order='45'/>
<cms:editable name='festival_brochure' label='Festival Brochure' desc='Upload the file here' type='file' order='50'/>
<cms:editable name="concert_thumbnails" label='Concert thumbnails' type='richtext' order='60'/>
</cms:template>
<!doctype html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="style.css">
</head>
<body>
<cms:embed 'upgrade_prompt.html' />
<div id="site-container" class="clearfix" role="main">
<h1 class="main-heading">Hatfield House Music Festival</h1>
<h2 class="date-of-festival">20th-23rd September 2012</h2>
<div id="main-nav">
<cms:embed 'main_nav.html' />
</div>
<br class="clear-both" />
<div id="sub-nav-container">
<ul id="sub-nav">
<cms:set current_page_name=k_page_name />
<cms:pages masterpage='concerts.php' orderby='concert_no' order='asc' >
<li><a href="<cms:show k_page_link />"<cms:if k_page_name=current_page_name> class="current"</cms:if>><cms:show k_page_title /></a></li>
</cms:pages>
<a href="<cms:show festival_brochure />" target="_blank" ><img class="float-left" src="img/brochure-download.gif" width="119" height="62" alt="brochure download"/></a>
</div>
<div id="left-column-concerts">
<div class="concert-info">
<h2><cms:show concert_date_time /></h2>
<h6><cms:show concert_venue /></h6>
<h3><cms:show featured_artist /></h3>
<h4><cms:nl2br><cms:show artist_extra /></cms:nl2br></h4>
<cms:if "<cms:not_empty concert_programme />">
<cms:nl2br><cms:show concert_programme /></cms:nl2br>
</cms:if>
<cms:if "<cms:not_empty concert_details />">
<cms:show concert_details />
</cms:if>
<h5><cms:show ticket_info /></h5>
<p><cms:show ticket_info_supplementary /></p>
</div>
</div>
<div id="right-column-concerts">
<cms:show concert_thumbnails />
</div>
<br class="clear-both" />
<cms:embed 'footer.html' />
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.1.min.js"><\/script>')</script>
<!-- end scripts -->
<cms:embed 'google_analytics_snippet.html' />
</body>
</html>
<?php COUCH::invoke(); ?>