

This way you can create a small navigation of content elements. If there is no item selected in the menu all contents are displayed. When you select an item on the content navigation, only that item is displayed:
temp.contentnav = CONTENT temp.contentnav { table = tt_content select { pidInList = this orderBy = sorting where = colPos=0 languageField=sys_language_uid } renderObj = TEXT renderObj { field = header wrap=<span class="text">|</span><br> typolink.parameter.field=pid typolink.parameter.dataWrap=| typolink.additionalParams.insertData=1 typolink.additionalParams=&content_id={field:uid} typolink.no_cache=1 if.isTrue.field=header } } page.10.subparts.CONTENTNAV < temp.contentnav
And this is the code, to show only the selected content element...
page.10.subparts.CONTENT> page.10.subparts.CONTENT=CONTENT page.10.subparts.CONTENT { table=tt_content select{ andWhere.insertData=1 andWhere=uid={GPvar:content_id} andWhere.if.isTrue.data=GPvar:content_id } }
Click here to see what it looks like




page.10>
page.10=CONTENT
page.10 {
table=tt_content
select{
andWhere.insertData=1
orderBy = sorting
andWhere=uid={GPvar:content_id}
andWhere.if.isTrue.data=GPvar:content_id
max = 1
}
}
temp.mainTemplate {
subparts.entrada = CONTENT
subparts.entrada {
table = tt_content
select.where = pid=21
select.andWhere = colPos=1
}
subparts.containers = CONTENT
subparts.containers {
table = tt_content
select {
pidInList = this
orderBy = sorting
where = colPos=0
}
renderObj = TEXT
renderObj {
field = header
wrap = |<br>
typolink.parameter.field = pid
typolink.parameter.dataWrap = |
typolink.additionalParams.insertData = 1
typolink.additionalParams = &faq={field:uid}
typolink.no_cache = 1
if.isTrue.field=header
}
}
#If item is selected
subparts.containers >
subparts.containers = CONTENT
subparts.containers {
table=tt_content
select{
where = colPos=0
andWhere.insertData=1
andWhere=uid={GPvar:faq}
andWhere.if.isTrue.data=GPvar:faq
}
}
}
page.10 < temp.mainTemplate
The second block for the selected item does overwrite everything at the first time. How can I define the condition so it only loads that when the $_GET variable is set??
Thank you
plugin.tx_automaketemplate_pi1 {
content.file = fileadmin/plantilla/sites/espacio_abierto/espacio_visitante/faqs/index.html
}
temp.mainTemplate {
subparts.entrada = CONTENT
subparts.entrada {
table = tt_content
select.where = pid=21
select.andWhere = colPos=1
}
subparts.containers = CONTENT
subparts.containers {
table = tt_content
select {
pidInList = this
orderBy = sorting
where = colPos=0
}
renderObj = TEXT
renderObj {
field = header
wrap = |<br>
typolink.parameter.field = pid
typolink.parameter.dataWrap = |
typolink.additionalParams.insertData = 1
typolink.additionalParams = &faq={field:uid}
typolink.no_cache = 1
if.isTrue.field=header
}
}
}
page.10 < temp.mainTemplate
[globalVar=GP:faq > 0]
page.10.subparts.containers >
page.10.subparts.containers = CONTENT
page.10.subparts.containers {
table=tt_content
select{
where = colPos=0
andWhere.insertData=1
andWhere=uid={GPvar:faq}
andWhere.if.isTrue.data=GPvar:faq
}
}
[end]
Add comment