Copied to clipboard

Flag this post as spam?

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


  • san 30 posts 51 karma points
    Feb 13, 2014 @ 12:39
    san
    0

    image slider

    Hi

    I am trying to place image slider for my homepage. Can you please help for writing xslt for image slider..

    thanks..

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Feb 13, 2014 @ 12:46
    Dennis Aaen
    0

    Hi San,

    Did you use Umbraco 7, if so you could try using this package: http://our.umbraco.org//projects/website-utilities/sliders

    If you use Umbraco 6 or version 4 you could try: http://our.umbraco.org/projects/website-utilities/nivoslider-for-umbraco

    /Dennis

  • san 30 posts 51 karma points
    Feb 13, 2014 @ 15:14
    san
    0

    Hi Dennis

    thanks for your reply. for your reference: http://www.jesperhannibal.dk

    when you click on this url i have catalogs i need to place a dropdown button. can you please provide an xslt for this ...

    regards san

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Feb 13, 2014 @ 15:30
    Dennis Aaen
    0

    Hi San,

    Just to be sure what you´re trying to do:

    You have getting your image slider to work on the site: http://www.jesperhannibal.dk right?

    And now you´re tryling to add a dropdown list on the catelog page or where should that be and what content should it hold?

    What version of Umbraco are you using?

    Loook forward to hear from you, and I will try to help if I can.

    /Dennis

  • san 30 posts 51 karma points
    Feb 13, 2014 @ 16:11
    san
    0

    Hi Dennis

    i am trying to build a site

    for your reference: http://w3cyfn.axshare.com/

    i am using version 6.

    In this i am trying to add dropdown & imagelogo & maps in the middle of my imageslider.

    any help ?

    thanks

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Feb 13, 2014 @ 19:46
    Dennis Aaen
    0

    Hi San,

    I assume that you have a document type for you frontpage. The way I usually do it, is by adding a tab on the frontpage document type called Site settings, on the that tab I add a property called of Site logo, so it gets the alias siteLogo. (The datatype is Media Picker) Then I create a XSLT that look like this:

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

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

    <xsl:param name="currentPage"/>

    <xsl:template match="/">
       
    <!-- start writing XSLT -->
    <xsl:if test="$currentPage/ancestor-or-self::*/siteLogo!=''">
        <div id="logo">
            <xsl:variable name="media" select="umbraco.library:GetMedia($currentPage/ancestor-or-self::*/siteLogo, 0)" />
            <xsl:variable name="alt" select="umbraco.library:GetMedia($currentPage/ancestor-or-self::*/siteLogo, 0)/@nodeName" />
            <a href="/">
                <img src="{$media/umbracoFile}" alt="{$alt}"/>
            </a>
        </div>
    </xsl:if>

    </xsl:template>

    </xsl:stylesheet>

    After that I add the macro to my Master template.I assume that the map is also a image, then you can do it like the same way that the logo. Again I have added a property called World map the datatype is (Media Picker) so it gets an alias of worldMap, and added to the Master template too, so it will be printet on all pages.

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

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

    <xsl:param name="currentPage"/>

    <xsl:template match="/">
       
    <!-- start writing XSLT -->
    <xsl:if test="$currentPage/ancestor-or-self::*/worldMap!=''">
        <div id="logo">
            <xsl:variable name="media" select="umbraco.library:GetMedia($currentPage/ancestor-or-self::*/
    worldMap, 0)" />
            <xsl:variable name="alt" select="umbraco.library:GetMedia($currentPage/ancestor-or-self::*/
    worldMap, 0)/@nodeName" />
            <a href="/">
                <img src="{$media/umbracoFile}" alt="{$alt}"/>
            </a>
        </div>
    </xsl:if>

    </xsl:template>

    </xsl:stylesheet>

    The dropdown can do make by adding a property on your document type give it a name, and choose the datype of dropdown, see the screenshot, I have added it on the Site setting tab,

    After that go to the developer section --> data types find the dropdown datatype, there you can add the pre-values for the dropdown list.

    The way you can print the picked value is by using this XSLT.

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


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

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

       <xsl:if test="$currentPage/ancestor-or-self::*/dropDown!=''">

                    <div id="dropDown">
                        <xsl:value-of select="$currentPage/ancestor-or-self::*/dropDown" />
                    </div>

            </xsl:if>

    </xsl:template>

    </xsl:stylesheet>

    In the XSLT examples, I always check if the fields have any data, if not I don´t print out the markup. If you have a field on a page the you want to print it can be done by using the $currentPage/propertyAlias. I have linked to the documentation for the XPath Axis: http://our.umbraco.org/wiki/reference/xslt/xpath-axes-and-their-shortcuts

    I hope this helps, and make sense.

    /Dennis

  • san 30 posts 51 karma points
    Feb 14, 2014 @ 11:14
    san
    0

    Hi Dennis

    Many thanks for your reply. i will try the XSLT file which you gave ..if any problem i will get back to you. thank you

Please Sign in or register to post replies

Write your reply to:

Draft