[TYPO3] [typo3] too lang navigation bar

Vincent Mans typo3.vincnet at gmail.com
Thu Aug 7 12:54:29 CEST 2008


Hi,

I used this solution:
In the title-field, the content editor can set a # to break the title
to the next line (so you get two lines per menu button). But of course
you can set a crop function in the php-include.


TS Setup:

includeLibs.menuSet = fileadmin/scripts/menu_itemArrayProcFunc.php

temp.menu1 = HMENU
temp.menu1.entryLevel = 1
temp.menu1.1 = TMENU
temp.menu1.1 {
 wrap = <ul>|</ul>
 itemArrayProcFunc = user_itemArrayProcFunc_Menu
 expAll=1
 NO.wrapItemAndSub = <li class="menu1item-no"> | </li>
 ACT = 1
 ACT.wrapItemAndSub = <li class="menu1item-act"> | </li>
 ACT.doNotLinkIt=1
 CUR = 1
 CUR.allWrap = <li class="menu1item-act"> | </li>
 CUR.doNotLinkIt=1
 ACTIFSUB=1
 ACTIFSUB{
  allWrap = <li class="menu1item-act"> | </li>
  doNotLinkIt=0
 }


The include file: menu_itemArrayProcFunc.php

<?php

       function user_itemArrayProcFunc_Menu($menuArr,$conf) {

         foreach($menuArr as $i=>$row){
               if(stristr($menuArr[$i]['title'], '#')) {
                       $title_exploded = explode('#',$menuArr[$i]['title']);
                       $title = '';
                       foreach($title_exploded as $k=>$sub){
                                $title .= '<span class="extra"
style="float:left;clear:both;cursor:pointer;">'.$sub.'</span>';
                       }
                       $menuArr[$i]['title'] = $title;
               }
               if(stristr($menuArr[$i]['nav_title'], '#')) {
                       $title_exploded = explode('#',$menuArr[$i]['nav_title']);
                       $title = '';
                       foreach($title_exploded as $k=>$sub){
                                $title .= '<span class="extra"
style="float:left;clear:both;cursor:pointer;">'.$sub.'</span>';
                       }
                       $menuArr[$i]['nav_title'] = $title;
               }
         }
               return $menuArr;
       }

?>

Greetz,
Vincent



2008/8/7 LinTong <pcu84424 at gmail.com>:
> Hallo everybady
>
> I have a navigation bar which looks like:
>
> root line/ level 1/ level 2/ current level
>
> But there is possibility that the name of level1 or level 2 is too
> lang. I would like to set a limit of each item in the navigation bar
> to max 10 characters. I tried several ways by using "stdWrap.crop" but
> it does not work. How can I modify my code? Thanks very much.
>
>
> the code is:
> ####top nav
> lib.topNav = HMENU
> lib.topNav.special = rootline
> lib.topNav.special.range = 0
> lib.topNav.1 = TMENU
> lib.topNav.1 {
>        noBlur = 1
>        NO.linkWrap = |&nbsp;/&nbsp;|*||*| |
>        NO.allWrap =
>        NO.stdWrap.htmlSpecialChars = 1
>        CUR = 1
>        CUR.allWrap = <span>|</span>
>        CUR.doNotLinkIt = 1
>
> }
>
> --
> Best Regards
> LinTong(Pierre)
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
>


More information about the TYPO3-english mailing list