Copied to clipboard

Flag this post as spam?

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


  • nelson 6 posts 26 karma points
    Aug 23, 2012 @ 02:53
    nelson
    0

    xslt images slider

    Hi, i have a problem, i have this xslt code:

    <?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]"/>

      <xsl:for-each select="$sliderNode/child::umediaSlider">    
                 
    <div class="slide">
    <a title="Noticia número 1" href="#" target="_blank"><img src="{umbracoFile}" width="547" height="230" /></a>
    <div class="caption2"><xsl:value-of select="@nodeName"/></div>
    <div class="caption">
    <p><xsl:value-of select="teaserText" disable-output-escaping="yes"/></p>
    </div>
    </div>

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

    </xsl:stylesheet>

     

    and this template code:

    <%@ Master Language="C#" MasterPageFile="~/masterpages/Master.master" AutoEventWireup="true" %>

    <asp:content ContentPlaceHolderId="MasterHeadPlaceHolder" runat="server">
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/slides.min.jquery.js"></script>
    <script type="text/javascript" src="js/function.js"></script>
    <link href="css/global.css" rel="stylesheet" type="text/css" />
    <!-- META Tag Macro -->
     <meta http-equiv="imagetoolbar" content="false" />
    </asp:Content>
      
    <asp:content ContentPlaceHolderId="MasterContentPlaceHolder" runat="server">
    <div id="destacados">
    <div class="titulo-seccion">Noticias Destacadas</div>
    <div id="container">
        <div id="example">
            <div id="slides">
                <div class="slides_container">

    <umbraco:Macro Alias="umediaSliderImages" runat="server"></umbraco:Macro>

    <div class="clear"></div>
    </div>
    <a class="prev" href="#"><img alt="Arrow Prev" src="images/arrow-prev.png" /></a>
    <a class="next" href="#"><img alt="Arrow Next" src="images/arrow-next.png" /></a>
            </div>      
        </div>
      
    </div>
    </div>
    <div class="encuesta">
    <div class="titulo-seccion">Encuesta</div>
    <div class="encuesta-content">
    <p>¿Por quién votarias en las próximas elecciones?</p>
    <input type="radio" name="group1" value="Carlos"/>Carlos Gomez<br />
    <input type="radio" name="group1" value="Jorge"/>Jorge Cuadros<br />
    <input type="radio" name="group1" value="Pedro"/>Pedro Muñoz
    </div>
    </div>
    <div class="foros">
    <div class="titulo-seccion">Foros</div>
    <ul>
    <li><a href="#">Deportes</a></li>
    <li><a href="#">Politica</a></li>
    <li><a href="#">Cultura</a></li>
    </ul>
    </div>
    <div id="resumenes">
    <div class="left">
    <h1>Titulo Noticia 1 {resumen}</h1>
    <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae e laudantium, totam rem aperiam</p>
    <img src="images/res1.jpg" />
    </div>
    <div class="right">
    <h2>Titulo Noticia 2 {resumen}</h2>
    <p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae e laudantium, totam rem aperiam</p>
    <img src="images/res1.jpg" />
    </div>
    <div id="bottom-content">
    <div class="titulo-seccion">Asociación de Padres de Familia</div>
    </div>
    </div>
    <div id="espacio"></div>
    <div class="clear"></div>
    </asp:Content

    the macro file has been created too

    i have created the document types "u.media sliders" and "u.media slider"

    also i have created two child nodes from a parent node in the content panel

    but the problem is the umbraco Macro with the alias: umediaSliderImages doesn't show the images slider.

    What could be the problem?

    Thanks for the answer.

  • Fuji Kusaka 2203 posts 4220 karma points
    Aug 23, 2012 @ 07:53
    Fuji Kusaka
    0

    Hi Nelson,

    I amuse you are uploading your images on each child node and have some description added to it right?

    If so try change your xslt to 

    <xsl:variable name="sliderNode" select="./*[@isDoc][not(umbracoNaviHide = 1)]"/>
      <xsl:for-each select="$sliderNode">                 
    .....
    </xsl:for-each>

    //fuji

  • Fuji Kusaka 2203 posts 4220 karma points
    Aug 23, 2012 @ 07:59
    Fuji Kusaka
    0

    Opps sorry missed something here

    <xsl:variable name="sliderNode" select="$currentPage/*[@isDoc][not(umbracoNaviHide = 1)]"/>
Please Sign in or register to post replies

Write your reply to:

Draft