This can be done using stdWrap.override
. If stdWrap.override
returns something non-empty, this value replaces the normal value stdWrap would return. In your case, this could look like this:
# Fetch the default content from the mainpage with id 58
lib.rightCol-1 = CONTENT
lib.rightCol-1 {
table = tt_content
select {
pidInList = 58
where = colPos=31
orderBy = sorting
languageField = sys_language_uid
}
# override the content from page 58 with content from the current page,
# but only if there is content on this page
stdWrap.override.cObject = CONTENT
stdWrap.override.cObject {
table = tt_content
select {
pidInList = this
where = colPos=31
orderBy = sorting
languageField = sys_language_uid
}
}
}
You can also create the following behaviour:
- If there is content on the current page, show it.
- Else, walk up the rootline and take the content from the first page that has content in the column.
- If there is no such page, take the content from the "mainpage".
This can be done by simply setting slide = -1
to the second CONTENT-Object.