mały problem z menu

Pomoc po polsku dla CMS Made Simple
Post Reply
Bl1nk

mały problem z menu

Post by Bl1nk »

Witam

Mam taki szablon menu:

Code: Select all

{* CSS classes used in this template:
.currentpage - The active/current page
.bullet_sectionheader - To style section header
hr.separator - To style the ruler for the separator *} 

{if $count > 0}
{foreach from=$nodelist item=node}
{if $node->depth > $node->prevdepth}
{repeat string="" times=$node->depth-$node->prevdepth}
{elseif $node->depth < $node->prevdepth}
{repeat string="" times=$node->prevdepth-$node->depth}

{elseif $node->index > 0}<br />
{/if}

{if $node->current == true}
-<a href="{$node->url}" class="currentpage"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext} </a>

{elseif $node->parent == true && $node->depth == 1}
<a href="{$node->url}" class="activeparent"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext} </a>

{elseif $node->type == 'sectionheader'}
-{$node->menutext}

{elseif $node->type == 'separator'}
- <hr class="separator" />

{else}
-<a href="{$node->url}"{if $node->target ne ""} target="{$node->target}"{/if}> {$node->menutext}</a>

{/if}

{/foreach}

{repeat string="-" times=$node->depth-1}</li>

{/if}
chcialbym aby to menu wyswietlalo tylko 4 najnowsze strony (ostatnio dodane), da się tak zrobić? mógłby ktoś dopisać te kilka linijek kodu? bo sam nie dam rady.. bylbym bardzo wdzięczny.

Pozdrawiam
numer9

Re: mały problem z menu

Post by numer9 »

prostego rozwiązania na ten temat nie znam, przyznam szczerze. Jest natomiast w bazie zapisywany parametr "last update", więc na pewno można dopisać moduł, który będzie wyświetlał menu w zależności od "świeżości" dodawania stron.

Ale szczerze mówiąc nie spotkałem się jeszcze z taką funkcjlonalnościa. Zazwyczaj, jak ktoś chce wyświetlać tylko najnowsze elementy (i chce zrobić to dynamicznie) - to polecam korzystanie z modułu news! Można tak ustawić szablon, żeby wyświetlały się jak strony, a mechanizm do datowania/sortowania/wyświetlania odpowiedniej liczby - już zrobione w podstawowym silniku. Co Ty na to?
Post Reply

Return to “Polish - Polski”