Include typo3 content elements on every page

You often want to include some content on every page of your website. There are a lot of different ways to accomplish this with typo3. Here's one quick solution: You create a hidden page or a page outside of your site tree, so that it doesn't show up in your menu. Then you simply add the content you want displayed on all pages to that page. When you hover over the icon next to the title of the content element (the one that lets you copy, cut etc) you see the object's ID.

If you want to include that element on every page, simply add it to your template using something similar to this:

temp.foo = RECORDS
temp.foo {
	tables = tt_content
	source = ID # Enter the object's ID here
}
That's all. You can also do this with all kind of plugins, many of them offer some kind of temp.foo < plugin.tx_extension_pi1 mechanism. It's usually documented in the extension manual.

8 comments

  1. avatar
    wrote this comment on

    Any ideas how this could be done for multilanguage content elements?

    Thanks!

  2. avatar
    wrote this comment on

    I'd assume that typo3 picks the correct language automatically, have you tried it?

  3. avatar
    wrote this comment on

    No, it doesn't pick the correct language. It simply shows the content element which has the provided id.

  4. avatar
    wrote this comment on

    Ah, makes sense I guess. You'll have to check for the language and pass the correct ID then.

  5. avatar
    wrote this comment on

    Yep, that's how I did it.
    Thank you.

  6. avatar
    wrote this comment on
    I am inserting this code in my sites general template, but nothing is happen. And second question is how can I determine the column in which I want the content element to appear? Thanks!
  7. avatar
    wrote this comment on
    Maybe, you use TemplaVoila?
  8. avatar
    wrote this comment on
    First of all, Thanks, Nicolas Its working for me and helpful to me to solve my issue. Thanks, Pradeep Chauhan TYPO3 Develoepr

Reply

Cancel reply
Markdown. Syntax highlighting with <code lang="php"><?php echo "Hello, world!"; ?></code> etc.
DjangoPythonBitcoinTuxDebianHTML5 badgeSaltStackUpset confused bugMoneyHackerUpset confused bugX.OrggitFirefoxWindowMakerBashIs it worth the time?i3 window managerWagtailContainerIrssiNginxSilenceUse a maskWorldInternet securityPianoFontGnuPGThunderbirdJenkinshome-assistant-logo