Copied to clipboard

Flag this post as spam?

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


  • Beginner 28 posts 78 karma points
    Aug 26, 2013 @ 18:46
    Beginner
    0

    A simple link

    Hi everyone!

    I have a image slider on my site and it contains a headertext, a text, a image and a link. I not sure how to make the link Work properly. My "solution" now is that i have created a richtextbox editor where I just write the text and add the link there. but is not working good. I get can se the html in the link"box", and its not working..

    Any ideas? my code is like this

     <div class="m-slider">
      <div class="slider-holder">
        <span class="slider-shadow">
          <xsl:text> </xsl:text>
        </span>
        <span class="slider-b">
          <xsl:text> </xsl:text>
        </span>
        <div class="slider flexslider">
          <ul class="slides">
            <xsl:for-each select="$sliderNode/umediaSlider">
              <li>
                <div class="img-holder">
                  <img src="{file}" width="741" height="347" />
                </div>
                <div class="slide-cnt">
                  <h2>
                    <xsl:value-of select="@nodeName"/>
                  </h2>
                  <div class="box-cnt">
                    <p>
                      <xsl:value-of select="teaserText" disable-output-escaping="yes"/>
                    </p>
                  </div>
                  <a href="" class="grey-btn">
                    <xsl:value-of select="mediaSliderLink"/>
                  </a>
                </div>
              </li>
            </xsl:for-each>
          </ul>
        </div>
      </div>
    </div>
    
  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Aug 26, 2013 @ 22:05
    Chriztian Steinmeier
    0

    Hi Beginner,

    So where does the link go? Is it internal (somewhere in the site) or external?

    Best option would probably be to use the URL Picker DataType in uComponents, if that's an option (uComponents is a separate package with lots of goodies).

    Second best - if the link is internal, use a Content Picker for the mediaSliderLink property, which stores an ID, and then you can use the NiceUrl() extension to get the URL, like this:

    <a href="{umbraco.library:NiceUrl(mediaSliderLink)}" class="grey-btn">Click Me</a>
    

    Lastly, if you just want to use the RTE that you've got now, do this instead:

    <xsl:value-of select="mediaSliderLink" disable-output-escaping="yes" />
    

    The disable-output-escaping attribute fixes the problem you have with the HTML tags being escaped.

    /Chriztian

  • Beginner 28 posts 78 karma points
    Aug 27, 2013 @ 18:09
    Beginner
    0

    Thanks! It Works great!

    I have also tried to do the same in my startpage which is not xslt. Like this: <a href="{umbraco.library:NiceUrl(item1Link)}" class="more" >read more</a>

    But it seems not to Work. What is the solution here??

  • Danny Blatant 91 posts 358 karma points
    Sep 08, 2014 @ 17:52
    Danny Blatant
    0

    Old thread, but just in case it helps someone...

    I am using Umbraco 7 and Found that (after not being able to find the simple Link Picker) the Multi URL Picker plugin works fine. It accepts a link, title and optional 'open in' variables, you can find it here : http://our.umbraco.org/projects/backoffice-extensions/multi-url-picker

    If you're using Umbraco 6, as Chriztian says above, uComponents (https://github.com/uComponents/uComponents) is the way to go!!

    Sadly there is no uComponents for Umbraco 7 however we do now have nuPickers (https://github.com/uComponents/nuPickers). This is a great package but also lacking a URL/Link picker at the moment.

    Ammendum : One of the admins, Jeavon just cam back to me with this too : http://www.nuget.org/packages/UrlPicker/, Kudos to him, seems to be just the job!

    Kind Regards,

     

    Danny "Blatant"

Please Sign in or register to post replies

Write your reply to:

Draft