Total freedom in menu programming with plugin pimenu

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
Piratos

Total freedom in menu programming with plugin pimenu

Post by Piratos »

Take a look here (german)
http://forum.cmsmadesimple.org/index.ph ... 940.0.html

Pimenu delivers data to smarty and with smarty you can make and use all of the  menusystems of the world.

here as example the template to produce the CSSMENU:

Code: Select all

<div id="listmenu">
<ul id="primary-nav-vert" class="cssmenu-vertical">
{foreach from=$rawmenu item=entry}
{if $entry->depth neq 0}

{if $entry->next_level > $entry->depth}
{if $entry->type <>'separator'}
<li class="menuparent"><a href="{$entry->url}"{if $entry->iscurrent eq 1}class="currentpage"{/if}>{$entry->menutext}</a><ul>
{else}
<li class="separator"><ul>
{/if}
{/if}

{if $entry->next_level == $entry->depth}
{if $entry->type <>'separator'}
<li><a href="{$entry->url}"{if $entry->iscurrent eq 1}class="currentpage"{/if}>{$entry->menutext}</a></li>
{else}
<li class="separator"><li>
{/if}
{/if}

{if $entry->next_level < $entry->depth}

{if $entry->next_level > 0}
{if $entry->type <>'separator'}
<li><a href="{$entry->url}"{if $entry->iscurrent eq 1}class="currentpage"{/if}>{$entry->menutext}</a></li></ul></li>
{else}
<li class="separator"></li></ul></li>
{/if}

{else}
{if $entry->type <>'separator'}
<li><a href="{$entry->url}"{if $entry->iscurrent eq 1}class="currentpage"{/if}>{$entry->menutext}</a>
{else}
<li class="separator">
{/if}

{/if}

{/if}

{else}
{$entry->trenner}
{/if}

{/foreach}
</div>

You must includes the javascript or stylesheets a menusystem needs manualy in the template.



i will make a download offer if the community it wishes.
piratos

Re: Total freedom in menu programming with plugin pimenu

Post by piratos »

And these are the datas you only need to make all menus and that is what pimenu delivers:


Deutsch  (German)
->number        Laufende Nummer des Datensatzes
->id            Id des Inhaltes
->type          Contentbezeichnung (content,separator und was auch immer enthalten ist)
->depth        Level des aktuellen Inhaltes
->last_level    Level des vorherigen Inhaltes
->next_level    Level des nächsten Inhaltes
->url          Den Link zum Inhalt (wenn nicht Separator oder Sectionheader)
->iscurrent    enthält 1 wenn die gerade angezeigte Seite identisch mit dem aktuellen Link ist

next_level enthält 0, wenn es sich um den letzten Datensatz handelt (der keine anderen Inhalte hat, dient nur
der Anzeige des Endes)

English

->number        Number of the record (not the Id)
->id            Id of the record
->type          Contenttype (content,separator, sectionheader etc.)
->depth        Hirarchy - Level of aktually record
->last_level    Hirarchy - Level of the prev record
->next_level    Hirarchy - Level of the next record
->url          Link of the record
->iscurrent    1 if the record is actually shown

next_level  is 0 if it the last record (no other contents only to mark the end).
Piratos

Re: Total freedom in menu programming with plugin pimenu

Post by Piratos »

Sorry i have forgotten one

->menutext    the text of the menu
Piratos

Re: Total freedom in menu programming with plugin pimenu

Post by Piratos »

Here a sample as how simple it is to create a new menusystem.
The picuture shows as the first menuentry the original cssmenu.
The next is the cssmenu build with the template.
And the next is the treemenu from the mygosuMenu project (see  http://gosu.pl/dhtml/mygosumenu.html ).

And this is all you need - a template for this

Code: Select all

<div class="DynamicTree">
<div class="top">Tree View</div>
<div class="wrap" id="tree">
{foreach from=$rawmenu item=entry}
{if $entry->depth neq 0}
{if $entry->next_level > $entry->depth and  $entry->type <>'separator'}
<div class="folder"><a href="{$entry->url}">{$entry->menutext}</a>
{elseif $entry->next_level == $entry->depth and  $entry->type <>'separator'}

<div class="doc"><a href="{$entry->url}">{$entry->menutext}</a></div>

{elseif $entry->next_level < $entry->depth and  $entry->type <>'separator'}
<div class="doc"><a href="{$entry->url}">{$entry->menutext}</a>{$entry->trenner2}
{/if}

{/if}

{/foreach}
</div></div>
You see - very simple and very small, no other modules or plugins are needed if you want to have another menusystem.

[attachment deleted by admin]
Piratos

Another sample bulletmenu

Post by Piratos »

You like the bulletmenu ?

Here you can see both - the original an the other which is made with a template and pimenu-

You can see the the original doesn't work correct from the first version until today.
It uses ul li and within hr too  - this causes an xhtmnl error.

The version with pimenu doesn't work with ul and li  and it is very simple
to make - here is the template:

Code: Select all

{foreach from=$rawmenu item=entry}
{if $entry->type <>'separator' and $entry->url<>''}
{$entry->indent}{$entry->bullet}<a href="{$entry->url}"{if $entry->iscurrent eq 1}class="currentpage"{/if}> {$entry->menutext}</a><br />
{elseif $entry->type =='separator'}
<hr class="separator" />
{/if}
{/foreach}


[attachment deleted by admin]
Piratos

Download now

Post by Piratos »

iNSiPiD

Re: Total freedom in menu programming with plugin pimenu

Post by iNSiPiD »

Using an unordered list is actually semantically correct for menus. The HR is a no-no though. There's no reason why a simple class couldn't be applied to an LI that is used as a separator. Applying a background image would be the best solution.

Good work, guys. I like this so far.
Piratos

Re: Total freedom in menu programming with plugin pimenu

Post by Piratos »

Applying a background image would be the best solution.
Yeah if  li hr /li is in use.

But with pimenu and a small template you must not use this because no li /li is in use.
The  function and optic is the same as orignal and  , the code is small:

Code: Select all

  ○<a href="http://localhost/ctest/index.php?page=contact-us"> Contact Us</a><br />
<hr class="separator" />
  ○<a href="http://localhost/ctest/index.php?page=svn-cvs-"> SVN (cvs)</a><br />
if someone don't like it he has the freedom to make what he want without a new menu module or plugin .

Pimenu is now version 1.01  - i have reformatted the source to make the code smaller.
Locked

Return to “Modules/Add-Ons”