Copied to clipboard

Flag this post as spam?

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


  • bob singh 47 posts 126 karma points
    Apr 23, 2013 @ 16:37
    bob singh
    0

    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

       
                     
                       

  • Rich Green 2246 posts 4008 karma points
    Apr 23, 2013 @ 17:00
    Rich Green
    0

    Hey Bob,

    Have a look inside your /App_Data/umbraco.config file and see what the alias is in there.

    Rich

  • bob singh 47 posts 126 karma points
    Apr 23, 2013 @ 17:18
    bob singh
    0

    Hi Rich,

    This is such a basic thing but it seems so complicated.. the alias is called link

    Regards

     

    Bob

  • Rich Green 2246 posts 4008 karma points
    Apr 23, 2013 @ 17:24
    Rich Green
    0

    We can't see your XSLT

    Rich

  • bob singh 47 posts 126 karma points
    Apr 23, 2013 @ 17:29
    bob singh
    0

    Oh sorry here it is in full -

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <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

  • Rich Green 2246 posts 4008 karma points
    Apr 23, 2013 @ 17:48
    Rich Green
    0

    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

  • Rich Green 2246 posts 4008 karma points
    Apr 23, 2013 @ 19:39
    Rich Green
    0

    Hey Bob,

    Sorry, may of confused you, is the image working? I can't see the problem in the link?

    Rich

  • bob singh 47 posts 126 karma points
    Apr 24, 2013 @ 09:59
    bob singh
    0

     

    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

Please Sign in or register to post replies

Write your reply to:

Draft