TYPO3Buddy is on FacebookTYPO3Buddy is on Twitter

Typoscript constants

When you use the same data in different typoscript templates, it's nice to know there's a way that you don't have to update this data in the different templates. Just update it once in a central place. Let's say you want to hide content based on your IP address. First step is to put this data in the constants section of your main typoscript template.

iphome =

Whenever you want to use this data in a typoscript template, you'll use {$iphome} in the setup part of the typoscript template. The following script won't show certain content when the IP address is or

[IP =,{$iphome}]
# do nothing
lib.header = HTML
lib.header.value (
    <script type="text/javascript">somescript;</script>
    <p>Show content</p>
    <p>And some more content</p>

More information on Typoscript constants here.

The TYPO3Buddy website is a tutorial to rebuild the TYPO3Buddy website from scratch. You can choose from a TYPO3 Fluid tutorial and a TYPO3 Templavoila tutorial. You'll build TYPO3 websites like you've done so for years!

Kind reminder! This tutorial has been tested with and updated for TYPO3 v10. Please keep in mind that the tutorial has once been set up for TYPO3 v6. It follows some deprecated conventions. If so, this will be mentioned in the tutorial.