I am failrly new to umbraco so I will try and explain this as close as possible and al help/suggestions are appreciated as I have been trying to solve this for hours
I have setup a new 6.0.3 umbraco system and installed the business template.
I would like to make the home sliders images click to a local page.
Using a Related Links Type with an Alias of 'link' to link to an internal page
But at present when I am using the following code in the xslt al I get is the page id i.e http://listerivf.whclpreview.com/1070 for the returned url
Require page name instead of id
Hi,
I am failrly new to umbraco so I will try and explain this as close as possible and al help/suggestions are appreciated as I have been trying to solve this for hours
I have setup a new 6.0.3 umbraco system and installed the business template.
I would like to make the home sliders images click to a local page.
Using a Related Links Type with an Alias of 'link' to link to an internal page
But at present when I am using the following code in the xslt al I get is the page id i.e http://listerivf.whclpreview.com/1070 for the returned url
Hey Bob,
Have a look inside your /App_Data/umbraco.config file and see what the alias is in there.
Rich
Hi Rich,
This is such a basic thing but it seems so complicated.. the alias is called link
Regards
Bob
We can't see your XSLT
Rich
Oh sorry here it is in full -
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets tagsLib BlogLibrary ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<!-- start writing XSLT -->
<xsl:variable name="sliderNode" select="$currentPage/parent::*/child::*[@level=1]"/>
<div id="slider">
<div id="imageSlider">
<xsl:for-each select="$sliderNode/child::umediaSlider">
<div class="imageSlide">
<div class="imageSliderInfo">
<h2> <xsl:value-of select="@nodeName"/></h2>
<xsl:value-of select="teaserText" disable-output-escaping="yes"/>
</div>
<div class="imageSliderImage">
<a href="{link}">
<img src="{umbracoFile}" width="500" height="320" />
</a>
</div>
</div>
</xsl:for-each>
</div>
</div>
</xsl:template>
</xsl:stylesheet>
Bob
Hey Bob,
I don't think that code works, try something like
<xsl:variable name="mediaId" select="number(nameOfImageProperty)" />
<xsl:if test="$mediaId > 0">
<xsl:variable name="mediaNode" select="umbraco.library:GetMedia($mediaId, 0)" />
<xsl:if test="$mediaNode/umbracoFile">
<img src="{$mediaNode/umbracoFile}" alt="[image]" height="{umbracoHeight}" width="{umbracoWidth}" />
</xsl:if>
</xsl:if>
Rich
Hey Bob,
Sorry, may of confused you, is the image working? I can't see the problem in the link?
Rich
Hi Rich,
I think Im just going to hardcode the links and only allow the changing of the images.
Many thanks for your help.
Bob
is working on a reply...