V-K
V-K

Reputation: 1347

TYPO3 using markers with conditions

There are some markers in my template. Sometimes markers can be empty, can I catch this situation? Something like:

if !###NEWS_IMAGE###

Upvotes: 0

Views: 299

Answers (1)

Bernd Wilke πφ
Bernd Wilke πφ

Reputation: 10790

Markers or Subparts have no logic in the template.

All logic has to be done while generating the replacement text.
IN PHP you can use the usual PHP control structures.

if you fill the markers with Typoscript you can use the options of stdWrap.if to fill in any replacement string, even an empty string.


in this way you can condition label to show only if the value is set:

marks {
    something = TEXT
    something.field = title

    something.wrap = the title is |
    something.wrap.if.isTrue.field = title

    something.ifEmpty = no title given
}

Upvotes: 1

Related Questions