Skip to content

Instantly share code, notes, and snippets.

@randomresult
Created October 27, 2013 06:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save randomresult/7178426 to your computer and use it in GitHub Desktop.
Save randomresult/7178426 to your computer and use it in GitHub Desktop.
Switch-Case mit TS-Setup-Constante #typo3 #fedext #fluid #vhs
//TYPOSCRIPT
//Values im Beispiel: 1 oder 2 - not set = default
plugin.tx_EXTNAME.settings.variableFOO = 1
//Frontendausgabe
<v:var.set name="variableFOO" value="{v:var.typoscript(path: 'plugin.tx_EXTNAME.settings.variableFOO')}"/>
<v:switch value="{variableFOO}">
<v:case case="1" break="TRUE">
<img src="typo3conf/ext/EXTNAME/Resources/Public/images/image_1.png" />
</v:case>
<v:case case="2" break="TRUE">
<img src="typo3conf/ext/EXTNAME/Resources/Public/images/image_2.png" />
</v:case>
<v:case case="default" break="TRUE">
<img src="typo3conf/ext/EXTNAME/Resources/Public/images/image_default.png" />
</v:case>
</v:switch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment