I have previously on this blog described a method I use to have total control of every page on my TYPO3 website. This method might not be the best solution, but it enables me to do what I want: control the content on every page of my website with the standard content elements of TYPO3. Let me give you an example: When you install tt_news and set it up, you will most like have 1 page in the pagetree for the LIST type, and 1 page in the pagetree for the SINGLE type. This means that all your news are shown on the page with the SINGLE type plugin. If you decide to add some google ads to that page, you will have to insert them on all the news, and you cannot easily make a different structure for your ads, or decide that some news don't have ads. This is because you only have the one RTE to write your text in.
Yesterday I decided that I would have a section with frequently asked questions about hypnosis and hypnotherapy. And since I'm a big fan of lib/div, I wanted to use the efaq extension (great extension by the way! very flexible). The way i configured the extension means that it is structured like the way I described tt_news. And this is rather limiting if I want to insert some content elements on the page where the answer is. I thought about how to solve it, and I figured that a custom tag like <content> would be nice. I figured that I couldn't be the only one who has ever wanted this feature, so I posted a request on the danish mailinglist to ask if such a solution existed out there. Christian Jul Jensen pointed me in the direction of typoscript, and I actually got it to work! Here's the typoscript I used:
lib.parseFunc_RTE.tags {
content = CONTENT
content {
table = tt_content
#List of UID's of pages where the content elements are
select.pidInList = 98
select.andWhere.current = 1
select.andWhere.wrap = uid=|
}
}
With this code I can simply write <content>23</content> to get the content element with ID=23. And now, you can do so too! As I said on the mailinglist, this is really the reason why TYPO3 is my favorite CMS. It also demonstrates the power of typoscript!
looks great! i didn´t know that! Thank you very much for this Information!
Greets
Ralf