user911282
user911282

Reputation: 93

Conditional wrap in TypoScript

I am rendering the content using following TypoScript:

temp.addcol5 = CONTENT
temp.addcol5 {
  table = tt_content
  select {
    pidInList = this
    orderBy = sorting
    where = colPos = 5
    languageField = sys_language_uid
  }
}
temp.addcol5.wrap = <div class="content middle"> | </div>

I want to wrap the content only if there are any records in the database. How can I achieve this?

Upvotes: 1

Views: 558

Answers (1)

Balaji D Loganathan
Balaji D Loganathan

Reputation: 430

You may want to try

temp.addcol5.stdWrap {
  wrap= <div class="content middle"> | </div>
  required =1
}

Upvotes: 4

Related Questions