typo3 - Typoscript Arrays and using them in FLUID -


assuming have project following web pages (please see screen shot)

enter image description here

the uids of red, blue, post , blog page 1,2,3 , 4 respectively.

now, want define array or kind of list in typoscript contain titles of root webpages. , array, can use in fluid template , display titles.

example:

  • in typoscript

    arrayoftitles= # titles of pages uid 1,2,3 , 4

  • in fluid page

    <f:for each="{arrayoftitles}" as="foo"> <h1> {foo} </h1> </f:for> 

is possbile

typoscript nature array, easiest way want add collection in template:

plugin.tx_yourext {   settings {     domains {       10 = 1       20 = 2       30 = 3       40 = 4     }   } } 

so can use directly in view

<f:for each="{settings.domains}" as="title">     <h1>{title}</h1> </f:for> 

on other hand, maybe better perform simple db query these pages database , create simple array , assign view param. in such case not need change ts in case of title change.

sql pseudocode:

select title pages is_siteroot = 1 , deleted = 0 , hidden = 0 order sorting asc 

edit:

you can common hmenu in typoscript (avoiding usage of views) create menu object special=list (of course instead 35, 56 should give there uids of root pages).

finally wrap each item <h1>|</h1> , add option: donotlinkit=1, snippet work (written top of head, need check it):

lib.mytitles = hmenu lib.mytitles {   special = list   special.value = 1,2,3,4    1 = tmenu   1.no.wrapitemandsub = <h1>|</h1>   1.no.atagtitle.field =  title   1.no.donotlinkit = 1 } 

Comments