Forum

Thread tagged as: Problem, Field-Types

Space after IMG Path Output

Hi I have a very simple layout that is not displaying properly because of a space that is output at the end of the path. In context it means that the image doesn't display.

The code for the content is:

<perch:content type="image" id="image" label="Project Image" bucket="photos" />

The code for the region is:

<?php perch_content('Image'); ?>

and this outputs:

/resources/photos/iotw2.jpg <- there is one space here!

The photo is uploaded via the Assets.

I've been through and checked everything I can think of, but drawing a blank. Why is this space being output and what can I do to remove it?

Thank you for any help Kind regards Steve

Steve Richardson

Steve Richardson 0 points

  • 7 years ago

Are you doing something like the following?

<img src="<perch:content type="image" id="image" label="Project Image" bucket="photos" />" />

Hi Brandon,

Not exactly, I literally just want the path for the image to be returned. So I literally just had the perch:content tag in there.

I've added some markup and it's working now. Actually I had to recreate it before the space disappeared. So perhaps it was just one of those weird invisible character gremlins.

Would be nice to track this down, but it's not important right now.

Thank you very much for your help Kind regards Steve