I dont want to Repeat Macro in Content Pages for my News.XSLT
Hi! I created a XSLT in my Web for News List.. and i added it into Master Template... it shows in all the content pages.. i dont to want this... my XSLT code is here <?xmlversion="1.0" encoding="UTF-8"?> <!DOCTYPExsl:stylesheet [ <!ENTITY nbsp " ">]> <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:umbraco.contour="urn:umbraco.contour"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 umbraco.contour tagsLib BlogLibrary ">
I used this Macro in Master Templete ..in this way.. <divstyle="float: right; width: 25%;"> <umbraco:MacroAlias="umbNewsListItems"runat="server"></umbraco:Macro> </div>
One way to do this would be to create a template that inherits from your Master, and create a placeholder in the Master. Put the macro inside the new template and only assign that template to the page(s) where you want the marquee (!) to show.
Otherwise, here's how you can limit the execution of the macro only to specific pages:
The highlighted if statement is where you add the condition - you can do lots of different stuff there - let me know if you need help in your specific case.
Hi Chriztian! Thanks for your kind suggestions.... actually am newbie in Umbraco... however i solved problem to another another way... yes i closed the node.....</xsl:if>... Your solution was correct but problem was in my doc types... again Thanks
Cheers: Azeem ravi
I would like intouch with you in future skype Name: azeemravi361
I dont want to Repeat Macro in Content Pages for my News.XSLT
Hi!
I created a XSLT in my Web for News List.. and i added it into Master Template... it shows in all the content pages.. i dont to want this...
my XSLT code is here
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<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:umbraco.contour="urn:umbraco.contour" 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 umbraco.contour tagsLib BlogLibrary ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<!-- The fun starts here-->
<div class="news">
<marquee behavior="scroll" scrollamount="2" direction="up">
<!--<xsl:variable name="newsNode" select="$currentPage/ancestor::root/HospitalNews [@isDoc]" /> -->
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide1) != '1']">
<xsl:sort select="@updateDate" order="ascending" />
<h3 class="headline">
<xsl:value-of select="@nodeName"/>
</h3>
<small class="meta">Posted: <xsl:value-of select="umbraco.library:LongDate(@updateDate, true(), ' - ')"/></small><br/>
<!-- <p class="introduction">-->
<xsl:value-of select="umbraco.library:ReplaceLineBreaks(NewsArticle)" disable-output-escaping="yes"/>
<!-- </p>-->
</xsl:for-each>
</marquee>
</div>
</xsl:template>
</xsl:stylesheet>
I used this Macro in Master Templete ..in this way..
<div style="float: right; width: 25%;">
<umbraco:Macro Alias="umbNewsListItems" runat="server"></umbraco:Macro>
</div>
if any Suggestions:
Thanks in Advance
Hi Azeem,
One way to do this would be to create a template that inherits from your Master, and create a placeholder in the Master. Put the macro inside the new template and only assign that template to the page(s) where you want the marquee (!) to show.
Otherwise, here's how you can limit the execution of the macro only to specific pages:
The highlighted if statement is where you add the condition - you can do lots of different stuff there - let me know if you need help in your specific case.
/Chriztian
Hi! Chriztian
if i added this line of code that you highlighted in XSLT add put id number of page... it shows error and XSLT even not saved
Thanks for your suggestion
Azeem Raavi
i also creat a new template.. and use it.. but issue not resolved
Hi Azeem,
Did you remember the closing </xsl:if> also (second-to-last line)? I didn't highlight it, so maybe you missed it...
That would explain the XSLT error...
/Chriztian
Hi Chriztian!
Thanks for your kind suggestions....
actually am newbie in Umbraco... however i solved problem to another another way...
yes i closed the node.....</xsl:if>...
Your solution was correct but problem was in my doc types...
again Thanks
Cheers: Azeem ravi
I would like intouch with you in future
skype Name: azeemravi361
is working on a reply...