Copied to clipboard

Flag this post as spam?

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


  • niccolo rossi 33 posts 53 karma points
    Aug 31, 2011 @ 12:53
    niccolo rossi
    0

    Macro dinamic parameter

    Hi all,

    i reallt need help :) 

    i've  a macro GoalInfo with 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: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="/">
      
       <xsl:copy-of select="/macro/Visibile" />
        <!-- start writing XSLT -->
        <img src="/media/426/goaltmp.jpg" /> 
    </xsl:template>
    </xsl:stylesheet>
     

     

     

     

    and a masterpage:

    <umbraco:Macro Visibile"aaa" Alias="GoalInfo" runat="server"></umbraco:Macro>
    So the problem is that if i pass Visibile like in the example (Visibile="aaa") everything is fine but when 
    i pass a value:
    "<umbraco:Item field="immagine" runat="server"/>" 

    all the macro disappear. 

    Whats wrong? the parameter that i want to pass is also a property of the document type of the master page. Can i read it in the xslt directly or i must pass it as a parameter? 

    please please help

    nico

     

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Aug 31, 2011 @ 13:07
    Dirk De Grave
    0
    <umbraco:Macro Visibile= "[#immagine]" Alias="GoalInfo" runat="server"></umbraco:Macro>

    as per this reference. (Above snippet will get the value of the page you're browsing, for recursive params, see the refs

     

    Cheers,

    /Dirk

     

  • niccolo rossi 33 posts 53 karma points
    Aug 31, 2011 @ 17:56
    niccolo rossi
    0

    thank you!

    now all works fine but 1 problem remain :(

    if i pass text / bool / number all is ok but when i try passing an html string, something like 

    <p>VERDVERDVERDVERDVERDVERDE</p>

    in the html page i see the html code not the html parsed. how can i resolve this? 

    really thank you for all

    nico

     

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Aug 31, 2011 @ 18:04
    Dirk De Grave
    0

    in xslt, you can use

    <xsl:value-of select="$parameter" disable-escaping="true" />

    so it renders correctly

     

    Cheers,

    /Dirk

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies