Forum

Thread tagged as: Blog, Question

Suppress working on blog items but not on blog images

As per Perch documentation I am trying to use suppress=true to hide some fields and images that are entered on post.html. However, it is not working on images

I have added suppress=true to <perch:blog id="image" etc but it is still displaying

When I add suppress=true to <perch:blog id="make" type="text" etc, it suppresses it fine

Is there a way to suppress the images from the blog post? They have to be on post.html so I can enter them, but I dont want to display them here.

suppress=true seems to be a depreciated attribute generally - but maybe its also a perch attribute?

Full code : NB 1st suppress on image doesnt work, 2nd suppress on non image attribute works fine.

          <perch:if exists="image"><img src="<perch:blog id="image" type="image" class="img-responsive"/>" alt="<perch:blog id="postTitle" suppress="true"/>" class="img-responsive center-block"  /></perch:if>

    <div class="row"><div class="col-xs-4"> MAKE:</div><div class="col-xs-8"> <perch:blog id="make" type="text" label="Make" order="2" size="m autowidth" required="true" suppress="true"  /></div>  </div>  
cow shed

cow shed 0 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

You don't have suppress="true" on any image, you have it on the alt attribute (which doesn't make sense as that is the title anyway).

Also all tags need a label, an id and a type. If you omit things you will get unexpected behaviour. These are Perch tags, nothing to do with HTML so you need to follow what is documented.

Thanks - guess I'd moved it around too many times - all working ok now.

I've got the image labels, id and types further down the post.html (its getting busy!) so all ok there too!

<perch:if exists="image"> <img src="<perch:blog id="image" type="image" class="img-responsive" label="Main Image" />" alt="<perch:blog id="postTitle" />" suppress="true" /> </perch:if>