Copied to clipboard

Flag this post as spam?

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


  • Roger 195 posts 474 karma points
    Sep 18, 2012 @ 10:40
    Roger
    0

    XSLT for displaying media image

    Hi all,

    Please can anyone help me with this:

    I am using a media picker to choose an image to display as part of a slide show with some text. (This was u.media slider but I have changed it due to it not working with the file upload)

    I am having trouble getting the XSLT correct to display the image. This is what I have at the moment:

    ---------------------------------------------------------------------------------------------------------------------------

    <xsl:variable name="sliderNode" select="$currentPage/parent::*/child::*[@level=1]"/>

     <div id="slider">
        <div id="imageSlider">
          <xsl:for-each select="$sliderNode/child::SliderContent">
               <div class="imageSlide">
                  <div class="imageSliderInfo">
                      <h2> <xsl:value-of select="@nodeName"/></h2>
                      <xsl:value-of select="introText" disable-output-escaping="yes"/>
                    </div>
                    <div class="imageSliderImage">
                      <img src="{umbracoFile}" width="500" height="332" alt="Slider Image"/>
                    </div>
                </div>
           
          </xsl:for-each>
       </div>
    </div>

    ---------------------------------------------------------------------------------------------------------------------------

    The text and slider is working but {umbracoFile} will not display the media file. I think I have this wrong.

    The output on page is:

    <img src="1082" width="500" height="332" alt="Slider Image" />

    Please can someone help me? Ive not had much luck on this forum with past posts so hopefully I can get some help with this one :)

    Thanks!

  • Roger 195 posts 474 karma points
    Sep 18, 2012 @ 14:56
    Roger
    0

    Ok, here is the solution. Ive worked it out after having little response :)

    If you are having issues with the u.media slider package where it wont publish when selecting a file to upload, you can change the file upload to the media picker (my media picker alias is called umbracoMediaFile but you can change it to what you want, just make sure you change the XSLT to reflect the media picker alias you have chosen) and change the XSLT to the following:

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


    <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::SliderContent">
               <div class="imageSlide">
                  <div class="imageSliderInfo">
                      <h2> <xsl:value-of select="@nodeName"/></h2>
                      <xsl:value-of select="introText" disable-output-escaping="yes"/>
                    </div>
                 
                 <xsl:if test="current()/umbracoMediaFile != ''">
        <xsl:variable name="umbracoMediaFile" select="umbraco.library:GetMedia(current()/umbracoMediaFile, 'false')" />
                        <div class="imageSliderImage">
                      <img src="{$umbracoMediaFile/umbracoFile}" width="500" height="332" alt="Slider Image"/>
                    </div>
      </xsl:if>
                 

                 
                </div>
           
          </xsl:for-each>
       </div>
    </div>

    </xsl:template>

    </xsl:stylesheet>

    This code will display images uploaded to the media folder that you select to display as the slider images

    I hope this helps someone :)

    Rog

  • Ramakrishnan 6 posts 26 karma points
    Mar 13, 2013 @ 13:04
    Ramakrishnan
    0

    We have created our own website which contains the image transition slider,it works fine in the localhost.The  image transition slider doesnt work in the siteadmin.how to make work over there.please suggest me an idea to resolve this issue.

  • Roger 195 posts 474 karma points
    Mar 13, 2013 @ 13:13
    Roger
    0

    Hi,

    Can you give a bit more detail please? Does the slider work when you test it on the domain? What are you seeing? What errors are you getting?

  • Ramakrishnan 6 posts 26 karma points
    Mar 21, 2013 @ 12:19
    Ramakrishnan
    0

    Hi Roger,

               We have replaced the slider with another slider.The issue has been resolved.Now we have another issue where we cannot edit the content in edit canvas mode.

    We are new to umbraco.The page need to be edited is simply displaying when we press edit canvas mode also.We could not edit any of the content.Please help us to edit the content of our page.We need to live edit the page.Is there an easy way to edit the content of the page.Could u please help us to resolve the issue.

    We have made changes to the umbracosettings.config file 

     <!-- clean editor content with use of tidy -->
        <TidyEditorContent>False</TidyEditorContent>
    <!-- Enables the experimental canvas (live) editing on the frontend of the website --> <EnableCanvasEditing>true</EnableCanvasEditing>
    we have made changes in this two lines for enabling the 'edit canvas mode',but also we cannot able to edit the content of the page.
    So,please help us to make learnt about the canvas mode and solve our issues too....

    Thanks&Regards
    -Ram
  • Ramakrishnan 6 posts 26 karma points
    Mar 21, 2013 @ 12:26
    Ramakrishnan
    0

    We have used another type of content editing also by installing the tinymce plugin to our umbraco.We couldnot able to save the content of our page.We doesnt know to save the content of our page.we have all the pages of .master files alone.so,please help us to use this plugin for saving our content....

     

    Thanks&Regards

    -Ram

  • Roger 195 posts 474 karma points
    Mar 21, 2013 @ 12:32
    Roger
    0

    Do you have the content of the Slider editable from the content tree also?

    for example, when you click on one of the slider child nodes, the content for that node appears to the right with the content editable?

  • Ramakrishnan 6 posts 26 karma points
    Mar 22, 2013 @ 09:12
    Ramakrishnan
    0

    Hi Roger,

             We have an problem with content editing in canvas mode.Whenever try to editing the content using canvas mode the content is open in new window but i can't able to edit.It is only readable format.Is there any way to enable the editable view .please give me a idea for how to enable the editable view in canvas mode.

    Thanks&Regards,

    -Ram

  • Roger 195 posts 474 karma points
    Mar 22, 2013 @ 12:20
    Roger
    0

    So are you saying that in canvas mode you are unable to click on the editable regions?

    If so, it sounds like you don't have canvas editing enabled correctly.

    If you do, there might be a jQuery issue there

  • Ramakrishnan 6 posts 26 karma points
    Apr 15, 2013 @ 08:33
    Ramakrishnan
    0

    Hai Roger,

    We are eager to work in umbraco, but til now we didn't get any solution to work in canvas editing.we couldn't able to overcome this issue.would u pleas help us to overcum this problem with a clear and brief description. We could not edit the contents,we enabled edit in canvas option in config file,but as of now it was not editable.

     

     

    Thanks&Regards

    -Ram

  • Ramakrishnan 6 posts 26 karma points
    Apr 16, 2013 @ 07:45
    Ramakrishnan
    0

    Hai,

    How to use page navigation in umbraco.i want to have link for the 2 or more pages.can you please brief me how to have navigation in umbraco.

    I have home.master page and carees.master page how to make a link for the careers.master page in home.master page.Please suggest me an idea to have a navigation in umbraco.

    Thanks&Regards

    -Ram

Please Sign in or register to post replies

Write your reply to:

Draft