Menus with graphical separators
From phpCMS
Suppose you want to realise a menu with separators to look like this example:
Home | Gallery | Guestbook | Sitemap
This is quite simple in phpCMS from version 1.2.1 on, as in the menu template (.mtpl) you can use for your menus not only the well known tags .PRE, .NORMAL, .ACTIV, and .PAST, but now also .BETWEEN.
(For older versions you will have to apply a patch (see below).
Here is an example for a menu template:
{MAIN.PRE}
<div class="mainmenu">
{MAIN.BETWEEN}
|
{MAIN.NORMAL}
<a href="{LINK}" title="{TEXT}">{MNAME}</a>
{MAIN.ACTIV}
<strong>{MNAME}</strong>
{MAIN.PAST}
</div>
[edit] Patch to apply to phpCMS versions < 1.2.1
In the phpCMS forum there was a thread (in German) started by Charly regarding this topic.
The principle of the patch is briefly explained here:
In the script include/class.parser_template_phpcms.php in function DoField directly after
for($k = 0; $k < $EntryCount; $k++) add the following code:
if($k > 0) {
$tempset = trim($MenuTemplate.\\\'.BETWEEN\\\');
if(isset($MENU->TEMPLATE->content->{$tempset})) {
$count = count($MENU->TEMPLATE->content->{$tempset});
for($m = 0; $m < $count; $m++) {
$MenuArray[$MenuArrayCounter] = $MENU->TEMPLATE->content->{$tempset}[$m];
$MenuArrayCounter++;
}
}
}
In the file include/class.parser_file_phpcms.php in function check_tag add the following code:
if(strstr($tag, \\\'.BETWEEN\\\')) {
return true;
}
Main Page: Tutorials MainPage | Top Page: MiniHowTos MainPage
Diese Seite in anderen Sprachen: Deutsch

