Copied to clipboard

Flag this post as spam?

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


  • Chris Buckland 10 posts 30 karma points
    Mar 02, 2013 @ 21:41
    Chris Buckland
    0

    Attach hyperlink to images in Front Page Slider (lofslider)

    Hey Guys,

    Just wondering if this is possible or not, we use a package called lofslider in our website and I have access in the backend to be able to assign images with a title and description. I can set within richtext editor hyperlinks on the text, but I would love to somehow generate a hyperlink from the actual image itself.

    lutanda (dot) com (dot) au is the domain

    I have tried to create a generic property umbracoLinkImage as per a couple of posts in the forum, but when I link it to the content tree it does not create the hyperlink to the page I set.

    Not sure what information is needed to explain this so I won't waste space on this first post sending through unnecessary xslt information and such.

    I have thought of trying to replace the existing slider with something else, but i would need to script it into the controls in the backend and I think that would be messy at best. Would love to try and work with what I have.

    Thanks, Chris

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 03, 2013 @ 09:05
    Jan Skovgaard
    0

    Hi Chris

    Could you show us the XSLT used to render the image slider?

    /Jan

  • Chris Buckland 10 posts 30 karma points
    Mar 03, 2013 @ 09:30
    Chris Buckland
    0

    Hey Jan,

    This is what I can see - I am going through the various video tutorials to gain some insight into Umbraco, but this is eluding me lol

    ------

    <?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:umbraco.contour="urn:umbraco.contour" xmlns:PS.XSLTsearch="urn:PS.XSLTsearch"
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour PS.XSLTsearch ">


      <xsl:output method="html" omit-xml-declaration="yes"/>

      <xsl:param name="currentPage"/>
      <xsl:param name="generateSliderMainPart" select="/macro/generateSliderMainPart" />

      <xsl:template match="/">

        <xsl:variable name="nodeIds" select="umbraco.library:Split($currentPage/slideShowNav,',')" />

        <xsl:for-each select="$nodeIds/value">
          <xsl:variable name="slide" select="umbraco.library:GetXmlNodeById(current()/.)"/>

          <xsl:if test="$slide!=''">
            <xsl:choose>
              <xsl:when test="$generateSliderMainPart='0'">            
                  <!-- get dd, mm, yyy values from yyyy-mm-ddT00:00:00 string -->
                  <xsl:variable name="dd">
                    <xsl:value-of select="substring($slide/date,9,2)" />
                  </xsl:variable>
                  <xsl:variable name="mm">
                    <xsl:value-of select="substring($slide/date,6,2)" />
                  </xsl:variable>
                  <xsl:variable name="yyyy">
                    <xsl:value-of select="substring($slide/date,1,4)" />
                  </xsl:variable>
                  <li>
                    <div>
                      <xsl:if test="$slide/navImage!=''">
                        <img src="{umbraco.library:GetMedia($slide/navImage, true)/umbracoFile}" />
                      </xsl:if>
                      <h3>
                        <xsl:value-of select="$slide/navHeading"/>
                      </h3>
                        <xsl:if test="$slide/date != ''">
                          <span>
                            <xsl:value-of select="$dd" />
                            <xsl:value-of select="'/'" />
                            <xsl:value-of select="$mm" />
                            <xsl:value-of select="'/'" />
                            <xsl:value-of select="$yyyy" />
                          </span> -
                        </xsl:if>
                      <xsl:value-of select="$slide/navBodyText"/>              
                    </div>
                  </li>            
              </xsl:when>
              <xsl:when test="$generateSliderMainPart='1'">
                <div class="lof-main-item">
                  <img src="{umbraco.library:GetMedia($slide/mainImage, true)/umbracoFile}" title="" height="300" width="900" />
                  <div class="lof-main-item-desc">          
                      <!--<a target="_parent" title="{$slide/heading}" href="#"><xsl:value-of select="$slide/heading"/></a>-->
                      <xsl:value-of select="$slide/bodyText" disable-output-escaping="yes"/>
                  </div>
                </div>
              </xsl:when>
            </xsl:choose>
          </xsl:if>
        </xsl:for-each>

      </xsl:template>

    </xsl:stylesheet>

    ------

    Ultimately at this point it is all a different language to me - I hope to fix that in the coming months though!


    Thanks for your reply, look forward to hearing back from you.

    Chris

Please Sign in or register to post replies

Write your reply to:

Draft