[Typo3-dev] recent work, ideas and thoughts

Tapio Markula tapio.markula at dnainternet.net
Fri May 13 08:11:31 CEST 2005


Hi Martin				

...[write your message here]...
Hi Wolfgang				

...[write your message here]...

I would be very useful to have many states, because in the menu can be many page types,
which just normal pages and spacer (SPC) has been taken account. I
tried to create USERDEF1 for  page types 'External URL' and 'Shortcut', but failed. Below is the failed code:

    
function specialLinks($menuArr,$conf)    {
        // Usage: In your TMENU/GMENU object insert this line:
        // itemArrayProcFunc = user_itemArrayProcFunc->specialLinks
        while(list($k,$v)=each($menuArr))    {
            if ($menuArr[$k]['doctype']==3 || 
            $menuArr[$k]['doctype']==4) 
            $menuArr[$k]["ITEM_STATE"]="USERDEF1"; 
        }
        return $menuArr;
    }
 
But that function doesn't do anything - I tested with another function.
and USERDEF1 itself worked fine (I tested with fake manu items from the 
example file).  For all possible pages types, which can be used in the navigation should be
easily  set link states..

I got this  fro a listmember  

There's no need to define the USERDEF states if thats all you 
want to do, as it can be done using pure TypoScript :)

Take a look at this example code:
-- cut --
temp.doktypeMenu = HMENU
temp.doktypeMenu.entryLevel = 1
temp.doktypeMenu.1 = TMENU
temp.doktypeMenu.1 {
  NO {
    stdWrap.cObject = CASE
    stdWrap.cObject {
      key.field = doktype
      default = COA
      default {
        10 = TEXT
        10.field = title
        10.wrap = |
 
      }
      # External URL
      3 = TEXT
      # Shortcut Pages
      4 = TEXT
    }
    allWrap = |
  }
}
-- cut --
 
What it does is using the CASE object inside the menu object, and 
create different renderings for each doktype.
 
"default" is everything not specific defined.
"3" is the External URLs
"4" is the Shortcut Pages
 
And since "3" & "4" is defined to show nothing, they menulinks won't 
show up on the menu.

I did corresponding script


temp.colSitemap.2 = TMENU
temp.colSitemap.2 {
expAll=1

  # Normal state properties

  NO {
      allWrap = <div class="csc-sitemap csc-sitemap-level2"> | </div>
      linkWrap=|
      stdWrap.cObject = CASE
      stdWrap.cObject {
      key.field = doktype
      default = COA
      default {
        10 = TEXT
        10.field = title
        10.wrap = <span>&nbsp;&#8226;&nbsp;|</span>
      }
      # External URL
      3 = TEXT
      # Shortcut Pages
      4 = TEXT  
  }
}

BUT the problem was that  SUBPAGES disappered - third and fourth level menus didn't work,
when I defined the CASE for the second level.
The code worked just in one level. the system could be much easier tha usein USERDEF1.
The CASE-system could however be more alternative for USEDEFX?
If the CASE would not really work , there is need for USERDEF3 etc.


- Tapio Markula (tmarkula)

-----------------------
This thread is located in the archive at this URL:
http://typo3.org/documentation/mailing-lists/dev-list-archive/thread/110109062/
					

- Tapio Markula (tmarkula)

-----------------------
This thread is located in the archive at this URL:
http://typo3.org/documentation/mailing-lists/dev-list-archive/thread/110109064/
					




More information about the TYPO3-dev mailing list