Forum

Thread tagged as: Question, Problem, Discussion

content output

I am looking to add a perch content region to this bit of code.

<!-- simple image -->
    <img class="rsImg" src="path-to-image.jpg" alt="image description" />

    <!-- lazy loaded image-->
    <a class="rsImg" href="path-to-image.jpg">image description</a>

This is the perch content region I would like in the area for the image. However when I try it I get bits of code hanging around in my page along with the image. So I was wondering if you could place the perch content code I have below in the proper areas of the "simple image" and "lazy loaded image" areas for me to observer.

Also does perch content region for image outputs ie.

photo_of_something.jpg

or does it output

<img src="photo_of_something.jpg" width="1600" height="1200" alt="photo">

The code below is the perch content I would use. (I think this is correct)

<perch:content type="image" id="image" label="Image" width="800" bucket="portfolio" />

Thanks M

Mark Chen

Mark Chen 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

That is a correct image tag for Perch and it will output just the path. You need to add HTML for the image element and perch content for anything else that is editable.

The documentation for the image tag is here, which explains this with a code example: https://docs.grabaperch.com/docs/templates/attributes/type/image/