

If you are using TemplaVoila, you might have noticed that the Menu/Sitemap type "Section index (pagecontent w/Index checked)", doesn't work correctly anymore. (Deleted elements show up on the menu and the sorting order is wrong.)
This is because TemplaVoila rendering doesn't rely on the sorting or the deleted fields, but instead stores a list of uids for the visible content elements in an extra pages field (tx_templavoila_flex).
With a little bit of TypoScript magic, we can solve that problem.
By storing the list of visible uids in a register value (recordsInTVField ), we can reuse the uidlist for making a TypoScript SQL lookup, returning only the visible CEs, and in the correct sorting order.
The register value could also be used in other scripts, where you need to know the list of CE uids.
In your TemplaVoila Data Structure (DS), locate all the fields which are set to hold Content Elements (CE)
It usually looks like this:
10 = RECORDS 10.source.current=1 10.tables = tt_content 10.wrap = <!--TYPO3SEARCH_begin--> | <!--TYPO3SEARCH_end-->
Change it to the following:
5 = LOAD_REGISTER 5.recordsInTVField.data = current:1 10 = RECORDS 10.source.data=register:recordsInTVField 10.tables = tt_content 10.wrap = <!--TYPO3SEARCH_begin--> | <!--TYPO3SEARCH_end--> 15 = RESTORE_REGISTER
Then in your TypoScript SETUP field, enter this:
tt_content.menu.20.3 > tt_content.menu.20.3 = CONTENT tt_content.menu.20.3 { wrap = <ul class="csc-menu csc-menu-3">|</ul> table = tt_content select.pidInList = this select.andWhere.dataWrap = uid IN ({register:recordsInTVField}) AND sectionIndex!=0 renderObj = TEXT renderObj { fieldRequired = header trim=1 field = header htmlSpecialChars = 1 wrap = <li class="csc-section">|</li> typolink.parameter.field = pid typolink.section.field = uid } }
NOTE: You should do this for every column in your Page DS, or you might end up with uid values
from the other columns.
This Snippet was submitted by Peter Klein




Add comment