Forum

Thread tagged as: Question

Stop template outputting empty class

Hi,

I have a template as follows:

<perch:if exists="header3"><h3 class="<perch:if exists="headingthirdclass"><perch:content id="headingthirdclass" type="select" label="Class" options="break" help="Select text indent" allowempty="true"/></perch:if>"><perch:content id="header3" type="text" label="Header"/></h3></perch:if>

and I'd like to know if there is a way to stop outputting, i.e. <h3 class></h3> in the HTML.

Any help would be thoroughly appreciated.

Garth Holmes

Garth Holmes 0 points

  • 4 years ago

Move

class=""

Inside your perch:if statement

Hi Robert,

My code is now:

<perch:if exists="header3"><h3 <perch:if exists="headingthirdclass">class="<perch:content id="headingthirdclass" type="select" label="Class" options="break" help="Select text indent" allowempty="true"/>"</perch:if>><perch:content id="header3" type="text" label="Header"/></h3></perch:if>

Thank you very much

Glad it works. Your welcome