Only set a marker if content is there

269 views Asked by At

I'm currently adding a custom marker to tt_news. I want to keep the design in the template. But if the markers are empty I get <br /><h2></h2> and so on. This only makes sense if there is a content. Currently I have the logic and the formatting in class.tx_tt_news.php. Is there another way?

1

There are 1 answers

0
Florian Rachor On

From what I read you put <h2>###GENERIC_MARKER###</h2> into the template. You better wrap the content in typoscript an set required=1. In this case the wrap will only be rendered when there is content. Example:

marker = TEXT
marker.field = title
marker.wrap = <h2>|</h2>
marker.required = 1