Forum

Thread tagged as: Question

Text appendage

Hi,

I'm trying to create a News style template, however; I am getting Alt text being appended to the News Article heading in Perch.

My code:

<perch:content type="checkbox" id="image-right" xmlns="https://www.w3.org/1999/html" value="1" label="Right Side Image" suppress="true" />

<perch:content type="checkbox" id="top-news-item" xmlns="https://www.w3.org/1999/html" value="1" label="Top News Item"  />

<div class="news-row">

<div class="accordion-head home">
    <h4 class="title panel news"><perch:template path="content/text.html" /></h4>
</div>

<perch:if exists="image-right">

<img class="inline right" src="<perch:content type="image" id="image" label="Image"/>" alt="<perch:content type="text" id="alttext" label="Alt" required="false" title="true" />" />

<perch:else />

<img class="inline left" src="<perch:content type="image" id="image" label="Image"/>" alt="<perch:content type="text" id="alttext" label="Alt" required="false"/>" />

</perch:if>

<div class="news-content"><perch:content id="news" type="textarea" label="Body" html="true"/></div>

</div>
Garth Holmes

Garth Holmes 1 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

At which point is it being appended? In the output or the edit form?

Hi Drew,

In the Edit form.

Thanks

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show me an example, because I can't understand what you're saying.

Hi Drew,

I could upload a picture somewhere and link to it but to try and explain, if I enter text in the either of the alttext fields, it appends it to the content that is created via the:

<perch:template path="content/text.html" />

tag.

I did not know you could reference .html templates from .html templates so maybe I am doing something wrong.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

I think you will need to show us what you are doing.