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:
this is probably not what you want to hear but to me the code looks absolutely fine to me and shouldn't lead to any performance or even timeout problems. Only thing you could do might be to get the 'modelNameImage' value only one, so
Then use this in the if statement and on GetMedia. However it's probably more for cleaner code than performance as you also introduce another variable which will create some overhead as well.
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
Hi curlybub,
this is probably not what you want to hear but to me the code looks absolutely fine to me and shouldn't lead to any performance or even timeout problems. Only thing you could do might be to get the 'modelNameImage' value only one, so
Then use this in the if statement and on GetMedia. However it's probably more for cleaner code than performance as you also introduce another variable which will create some overhead as well.
Cheers,
Sascha
Thanks Sasha, I'll try that one out. ;D
is working on a reply...