https://www.icyphoenix.com/viewtopic.php?f=36&t=3999&p=27004#p27004 ----------------------------------- moreteavicar Mon 31 Mar, 2008 15:56 Re: [Fixed] Posible "Bug" In Header Blocks (only O ----------------------------------- Well the breadcrumb tpls are a new idea, but only included in some templates. The idea is to have a php script which parses all the link variables to the links template, depending on the page being viewed - so you only really need one template, and this displays all the link output. [code linenumbers=false] $current_page= $_SERVER["PHP_SELF"]; switch($current_page) { case 'forum': $nav_link="". $lang['forum']."";(seems better to me to put the ahref in the variable, as it would allow more than one link) $bottom output=$blah blah; break; } $template->assign_vars(array( 'NAV_LINK' => $nav_link, 'BOTTOM_OUTPUT' => $bottom output [/code] then in template: [code linenumbers=false]
{L_HOME}{NAV_SEP}{NAV_LINK}
{CURRENT_TIME} |
{BOTTOM_OUTPUT}
[/code] Obviously the above is an example, but I do have something similar to this partially working (i.e. not on all pages) on my icps2007 template, but never finished doing it... as I was doing it a slightly harder way and putting the php in my navlinks template file. Probably the best way to implement this now is to use the global blocks feature, and create the nav links as a block file, so you can have php in one block file parsing the link variables to the block template - and if you don't want it on a certain page, you don't have to add it. And thing would be a "default link" which just gives the current page link, and no bottom right output - this would allow it to work on pages created through cms. The term "navlinks" - now this is where some confusion arises over past icy and phpbbxs - the left site navigation used to be called nav_quick_links, and the template file still is, yet it is referred to in CMS as a nav links block, whereas traditionally the nav links is the top dynamic link which changes on page (referred to as navlinks mainly because thats it's div class). Now some parts are being called "breadcrumbs", which is an attempt at making something easier to include, but most pages still have their own navlinks block, which is a real bugger if you want to give the navlinks block hover "effects" like on my templates.., and even add the same table header left, center, right image layout as main forum tables... There is one down-side to this approach, it means that when you create a new theme, you also have to supply the navlinks block, and the user must add the global block to every page they want it... which could be a pain in the neck whenever they switch back to old-fashioned mg_themes.... The other alternative (my preferred) is to issue a "mod" for page_header to parse the case logic variables, along with a completely revamped mg_themes which includes the single template file, in that way there is no need to add the global block to every page. It just requires, though a rethink on the way the current themes work (though it has been happening on and off).