[TYPO3] How to show content from parent page to all subpages
JoH
info at cybercraft.de
Wed Aug 15 13:17:27 CEST 2007
>>>>> I have a question. There is some pages that includes many subpages
>>>>> (more than 150) I need to display content from parent page to all
>>>>> subpages, without copy.
>>>>> Any advice?
>>>> Check kb_cont_slide
>>>
>>> Not necessary anymore.
>>> It's part of the core now.
>>> Check TSref for CONTENT => slide:
>>> http://typo3.org/documentation/document-library/references/doc_core_tsref/4.1.0/view/8/9/
>>>
>>>
>>> But in this case pidInList might be the better choice, since slide
>>> only works, if there is no content for the current page at all.
>>>
>>> You can create a COA array to display the default content before the
>>> content of the page itself::
>>>
>>> temp.mycontent = COA
>>> temp.mycontent {
>>> 10 = CONTENT
>>> 10 {
>>> table = tt_content
>>> select {
>>> pidInList.data = leveluid:2
>>> # or any other level instead of 2
>>> # depends on the level of the parent pages
>>> }
>>> }
>>> 20 < styles.content.get
>>> }
>>
>
> So, as I see this solution used marks. Is any solution for this
>
> parent page
> child page 001
> ...
> child page 100
>
> So I nee to set TS code to parent page for display all content from
> parent to child pages
This solution doesn't use any marks. I just used "temp.mycontent" because I
don't know your TS structure.
In fact it's just vice versa: You set the code for the subpages, to have
them fetch the content from a lower level.
You just have to set the correct level (corresponding to your "parent page")
If your parent page is on level1 it will look like this:
temp.mycontent = COA
temp.mycontent {
10 = CONTENT
10 {
table = tt_content
select {
pidInList.data = leveluid:1
# or any other level instead of 1
# depends on the level of the parent pages
}
}
20 < styles.content.get
}
and to make sure the content won't be doubled for the level1 pages:
[treeLevel = 0,1]
temp.mycontent.10 >
[global]
You can even make it dynamically fetch content from any parent page if you
use negative levels:
temp.mycontent = COA
temp.mycontent {
10 = CONTENT
10 {
table = tt_content
select {
pidInList.data = leveluid:-2
}
}
20 < styles.content.get
}
but this would work for all sub-subpages as well, and they would fetch the
content from their parent page. So I guess the better solution will be using
positive level values.
HTH
Joey
More information about the TYPO3-english
mailing list