Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • curlybub 133 posts 107 karma points
    Aug 06, 2010 @ 06:45
    curlybub
    0

    Display image from the parent node

    Hi umbraco people,

    This is my content structure:

    Content
      ---- Home
          ---- Model Line Up
              ---- Cars
                  ---- Lancer Evolution X (the xslt in this area)
                        ---- Features
                        ---- Specifications
                        ---- Gallery
                  ---- Lancer EX
                        ---- Features
                        ---- Specifications
                        ---- Gallery
                  ---- Galant
                        ---- Features
                        ---- Specifications
                        ---- Gallery
              ---- SUV
                  ---- Outlander

    I have a single image using media picker on Lancer Evolution X, Lancer EX and Galant. On the model line up section, the categories are listed and under them are the cars. When they choose a car, it redirects the user to the features section.

    What I want to do is to display the image from the car datatype when the user is redirected to the pages under it. I can make it work but performance suffers, im getting timeouts on the website. Im using this xslt to display the image:

    <xsl:if test="$currentPage/parent::node/data [@alias='modelNameImage'] != ''" >
     <img alt="{$currentPage/parent::node/@nodeName}">
      <xsl:attribute name="src">
       <xsl:value-of select="umbraco.library:GetMedia($currentPage/parent::node/data [@alias='modelNameImage'], 'false')/data [@alias='umbracoFile']" />
      </xsl:attribute>
     </img>
    </xsl:if>

    Are there other ways to get the image without making the performace of the site suffer?

    Thank you.


    Regards,
    Harry


Please Sign in or register to post replies

Write your reply to:

Draft