[TYPO3] How to loop in TS?

Tyler Kraft tyler.kraft at netefficiency.co.uk
Tue Apr 8 11:37:56 CEST 2008


Really easy, look at tsref in the tmenu and tmenuitems parts.

temp.quickMenu-list = HMENU
temp.quickMenu-list {
	special = list
	special.value = 90,89,87
	1=TMENU
	1.wrap=<select>|</select>
	1.NO{
		doNotLinkIt = 1
		subst_elementUid = 1
		stdWrap = <option value="/index.php?id={elementUid}">|</option>
	}
}


This isn't tested but it'll be the general idea.

tht


Mattias Borell wrote:
> Hi all.
> 
> I've been given a design that calls for an html select-list where each 
> option has a page UID as value, and the page title between the 
> option-tags. As the list of UIDs changes a bit depending on where you 
> are in the site(s), my first thought was that split would be the right 
> tool.
> 
> So far, I've managed to make it work with the dataWrap-like syntax so 
> that I can get the page titles, but I can't get the UIDs themselves...
> 
> TS-example:
> 
> temp.quickMenu-list = TEXT
> temp.quickMenu-list {
>   value = 90,89,87
>   split {
>     token = ,
>     cObjNum = 1
>     1.current = 1
>     1.wrap = <option value="???">{DB:pages:|:title}</option>
>   }
>   insertData = 1
> }
> 
> I can't seem to find a way to make a {DB:X:Y} that just gives the active 
> uid, and using a combination of standard wrap (|) and the {DB:X:Y} 
> doesn't seem to work either. What am I missing here? Do I need to make 
> this in separate steps, use another approach or...?
> 
> /Mattias, seeking TS enlightenment... :->


More information about the TYPO3-english mailing list