ich habe ein Menü-Problem und finde einfach nicht heraus, woran es liegt.
Statisch programmiert funktioniert mein Style-Sheet wie gewünscht. Die aktive Seite ist größer und orange dargestellt (siehe Anhang so soll es aussehen.png).
Der dazugehörende Code ist:
Code: Select all
#navlist
{
width: 85%;
text-align: left;
margin: 0 auto;
padding: 10;
text-indent: 10;
list-style-type: none;
}
#navlist li
{
padding: 10;
margin: 10;
text-indent: 10;
display: inline;
}
#navlist li a
{
letter-spacing: 0px;
text-decoration: none;
color: #7F7F7F;
font-size: 1em;
padding: 2 2px;
border-top: .5em solid #ffcc22;
}
#navlist li a:hover,#navlist a#current
{
color: #006699;
border-top: none;
font-size: 1.5em;
}
#navlist a#current { color: #ffcc22; }
Nach der Umsetzung für CMSms sieht es aus wie der zweite Anhang so sieht es aus.png. Keine Markierung der aktiven Seite durch großen orangefarbenen Text.
Ich habe den Code etwas angepasst, damit er zum Menü-Template passt:
Code: Select all
#navlist
{
width: 85%;
text-align: left;
margin: 20px ;
list-style-type: none;
}
#navlist ul
{
padding-top: 20px;
margin: 10px;
text-indent: 0;
}
#navlist li
{
margin: 5px;
text-indent: 5px;
display: inline;
}
#navlist li a
{
letter-spacing: 0px;
text-decoration: none;
color: #7F7F7F;
font-size: 1em;
padding: 0 2px;
border-top: .5em solid #ffcc22;
}
#navlist a#menuactive
{
color: #ffcc22;
border-top: none;
font-size: 1.5em;
}
#navlist li a:hover
{
color: #006699;
border-top: none;
font-size: 1.5em;
}
Code: Select all
{* CSS classes used in this template:
#menuwrapper - The id for the <div> that the menu is wrapped in. Sets the width, background etc. for the menu.
#navlist - The id for the <ul>
.menuparent - The class for each <li> that has children.
.menuactive - The class for each <li> that is active or is a parent (on any level) of a child that is active. *}
{if $count > 0}
<div id="menuwrapper">
<ul id="navlist">
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="<ul>" times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="</li></ul>" times=$node->prevdepth-$node->depth}
</li>
{elseif $node->index > 0}</li>
{/if}
{if $node->parent == true or ($node->current == true and $node->haschildren == true)}
<li class="menuactive menuparent"><a class="menuactive menuparent"
{elseif $node->current == true}
<li class="menuactive"><a class="menuactive"
{elseif $node->haschildren == true}
<li class="menuparent"><a class="menuparent"
{elseif $node->type == 'sectionheader'}
<li class="sectionheader"><span> {$node->menutext} </span>
{elseif $node->type == 'separator'}
<li style="list-style-type: none;"> <hr class="separator" />
{else}
<li><a
{/if}
{if $node->type != 'sectionheader' and $node->type != 'separator'}
href="{$node->url}" {if $node->accesskey != ''}accesskey="{$node->accesskey}" {/if}{if $node->tabindex != ''}tabindex="{$node->tabindex}" {/if}{if $node->titleattribute != ''}title="{$node->titleattribute}"{/if}{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}</a>
{elseif $node->type == 'sectionheader'}
>
{$node->menutext}</a>
{/if}
{/foreach}
{repeat string="</li></ul>" times=$node->depth-1} </li>
</ul>
<div class="clearb"></div>
</div>
{/if}
Meine Frage ganz konkret:
Mache ich einen Denkfehler im CSS oder fehlt mir wirklich ein Zustand im Menütemplate - und wie müsste ich den einbauen?
Danke und gute Nacht
Jester