Image Formating

Rachel Oakland's Avatar

Rachel Oakland

18 Aug, 2015 11:52 PM

I'm having trouble getting the images to display properly for our news highlight section. All of the other information displays perfectly and I have managed to get the items limited to three but the same picture is showing up for each story. I've tried several variations and I either end up with the same picture over and over again or no pictures at all.

  1. 1 Posted by Ryan Griffith on 19 Aug, 2015 12:05 PM

    Ryan Griffith's Avatar

    Hi Rachel,

    It looks like you are on the right track, but I am seeing a couple of issues:

    • When testing for a chosen asset, test if the path is /, not the link. This is because when there is no chosen asset, the link will not be present. Example: <xsl:if test="chooser-field/path != '/'">
    • You are already inside of a system-page template, so using //system-page will not work and will output the first system-page found within the XML. Instead use the following:
      <xsl:if test="system-data-structure/main-image/link != '/'">
      <img alt="{system-data-structure/main-image/name}" height="165" src="{system-data-structure/main-image/link}" width="250"/>
      </xsl:if>
      

    Please let me know if you have any questions.

    Thanks!

  2. 2 Posted by Rachel Oakland on 19 Aug, 2015 01:40 PM

    Rachel Oakland's Avatar

    Hi Ryan

    Thank you so much for the quick response. That worked perfectly! I thought I had tried to remove the system page portion from the if test but I guess I didn't change both things at once.

    Thanks again.

    Rachel

  3. 3 Posted by Ryan Griffith on 19 Aug, 2015 03:50 PM

    Ryan Griffith's Avatar

    Not a problem at all, Rachel, I am glad to hear my proposed changes did the trick.

    I'm going to go ahead and close this discussion, please feel free to comment or reply to re-open if you have any additional questions.

    Have a great day!

  4. Ryan Griffith closed this discussion on 19 Aug, 2015 03:50 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac