Guest gl82 Posted February 5, 2012 Share Posted February 5, 2012 Hi When the site docs are displayed along the top of a page I need the last menu item to have a class like ="last_item" added to it. That way I can remove the right | border that appears on the last menu item. I had a look through the forum posts and found a post that may look like it addresses the question however I do not have permission to view that post. I presume I have to add some php if statement asking if this is the last item and if it is add something etc Thanks in advance :) Quote Link to comment Share on other sites More sharing options...
Robsta Posted February 5, 2012 Share Posted February 5, 2012 Something similar is already in there. Look in the template for the comment section after the LI code. Quote Link to comment Share on other sites More sharing options...
Guest gl82 Posted February 6, 2012 Share Posted February 6, 2012 Hi Rob thank you for the prompt response, could you advise on what file please to look in please Quote Link to comment Share on other sites More sharing options...
leeofaccy Posted February 6, 2012 Share Posted February 6, 2012 Hi It should remove itself, unless the code has been modified on either includes/boxes/siteDocs.inc.php or skins/YOUR_SKIN/styleTemplates/boxes/siteDocs.tpl On the inc file you should have this..... ## Build attributes if ($results) { $maxi = count($results); foreach ($results as $i => $result) { if ($i<$maxi-1) { $box_content->parse('site_docs.a.sep'); } And on the tpl file, this... <!-- BEGIN: a --> <a class="txtSiteDocs" href="{DATA.doc_url}" {data.doc_url_target}="">{DATA.doc_name}</a> <!-- BEGIN: sep --><span class="txtSiteDocs">|</span><!-- END: sep --> <!-- END: a --> This adds a seperator to each document except the last one. Lee Quote Link to comment Share on other sites More sharing options...
Guest gl82 Posted February 7, 2012 Share Posted February 7, 2012 hmm ok i have the same in the include file, but not in the tpl. How does it know not to add it to the last one, thank you for the feedback? I can program in php and java etc so just curious as it doesn't appear to have any condition or loop in the tpl file This is what the siteDocs.tpl file currently has <!-- BEGIN: site_docs --> <div id="menu"> <ul> <li class="current_page_itemS"><a href="index.php">Home</a></li> <!-- BEGIN: a --> <li><a href="{DATA.doc_url}" class="txtSiteDocs" {DATA.doc_url_target}>{DATA.doc_name}</a></li> <!-- END: a --> </ul> </div> <!-- END: site_docs --> This is what I will change it to <!-- BEGIN: site_docs --> <div id="menu"> <ul> <li class="current_page_itemS"><a href="index.php">Home</a></li> <!-- BEGIN: a --> <li><a href="{DATA.doc_url}" class="txtSiteDocs" {DATA.doc_url_target}>{DATA.doc_name}</a></li> <!-- BEGIN: sep --><span class="txtSiteDocs">|</span><!-- END: sep --> <!-- END: a --> </ul> </div> <!-- END: site_docs --> Quote Link to comment Share on other sites More sharing options...
leeofaccy Posted February 7, 2012 Share Posted February 7, 2012 Everything is controlled by the include file and parsed to the tpl file. On the include file, you have this condition to parse a seperator, except the last one (hence the -1)... if ($i<$maxi-1) { $box_content->parse('site_docs.a.sep'); } Lee Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.