VF DSL 468x60

Menu as un-nested lists (iphone navigation)

Submitting your vote...
Rating: 4.2 of 5. 5 vote(s).
Click the rating bar to rate this item.

Here's a TS snippet I made a couple weeks ago, trying to emulate the setup of the menu at:

joehewitt.com/files/iphone/navigation.html

 

It uses the page ids for generating the CSS ids.

If a page has subpages, then the CSS id is added as section (#), otherwise it just links to the page.

 

 

lib.iPhoneMenu = COA
lib.iPhoneMenu {
   
  # Example TypoScript setup for creating a menu as un-nested lists.
  # For use with the CSS/JS setup found at http://joehewitt.com/files/iphone/navigation.html
   
  wrap = <div class="iPhoneMenu"> | </div>
  10 = HMENU
  10.entryLevel = 0
   
  # 1st level
  10.1 = TMENU
  10.1 {
    stdWrap.dataWrap = <ul id="c{field:pid}" selected="true"> | </ul>
    expAll = 1
    NO {
      linkWrap = <li>|</li>
    }
    IFSUB < .NO
    IFSUB = 1
    IFSUB.doNotLinkIt = 1
    IFSUB.stdWrap.typolink.parameter.data = page:uid
    IFSUB.stdWrap.typolink.section.field = uid
  }
   
  # 2nd level
  20 < .10
  20.1.stdWrap.dataWrap >
  20.1.NO.doNotShowLink = 1
  20.1.IFSUB.doNotShowLink = 1
  20.2 < .10.1
  20.2.stdWrap.dataWrap = <ul id="c{field:pid}"> | </ul>
   
  # 3rd level
  30 < .20
  30.2.stdWrap.dataWrap >
  30.2.NO.doNotShowLink = 1
  30.2.IFSUB.doNotShowLink = 1
  30.3 < .10.1
  30.3.stdWrap.dataWrap = <ul id="c{field:pid}"> | </ul>
   
  # 4th level
  40 < .30
  40.3.stdWrap.dataWrap >
  40.3.NO.doNotShowLink = 1
  40.3.IFSUB.doNotShowLink = 1
  40.4 < .10.1
  40.4.stdWrap.dataWrap = <ul id="c{field:pid}"> | </ul>
}

 

This snippet was submitted by Peter Klein



Comments


Stig, 11-11-07 21:00:
Cool stuff!
bignut, 01-12-07 02:56:
can someone show in detail what else is needed besides the snippets in the template setup?

i got this error ...
The page is not configured! [type= 0][]
radu, 15-02-08 13:24:
make sure you create the page object on your template ;) (with type = 0)
tomas, 05-03-08 08:27:
Have you checked the css in different browsers? IE7 doesn't work for me - FF2 = ok

Add comment

* - required field

*



*
*

Top 10 Updates

Creating a simple Infocenter using TYPO3 geändert am  17-Nov-2009 11:12:52
Making the Section Menu work correctly with TemplaVoila geändert am  05-May-2009 10:27:17
Show pages with type "Not in Menu" in a sitemap geändert am  05-May-2009 10:11:17
Implementation of the DHTML menu from brainjar.com  geändert am  01-Feb-2009 13:02:48
Sample DHTML menu geändert am  01-Feb-2009 12:51:25
A introduction to the CONTENT object geändert am  26-Jan-2009 12:20:39
Sample for dynamic image masks geändert am  16-Dec-2008 15:42:32
Useful Links geändert am  11-Dec-2008 10:06:17
Using Transparent PNG's in IE5/6 without JavaScript geändert am  04-Oct-2008 12:27:15
Using lightbox without extension geändert am  13-Jun-2008 14:20:51

Latest comments

23-Feb-2010 04:40:25
Janna schrieb: what about the css? I am still not clear how to link typoscript with the css. Kindly...
Text menu
05-Feb-2010 18:38:50
Martin Terber schrieb: Didn't work for me neither. I will try in TMENU now.
Alternativ sorting for menu items
27-Jan-2010 23:41:31
romx schrieb: U know its dob't work apply to Tmenu))
Alternativ sorting for menu items
Deutsch
Search: