I'm trying to restrict posting comments on blog for umbraco by using xslt to check if the user is logged in or not. Inside the xslt if condition i inserted the umbraco macro for posting comments on the blog. I received an error that says.
Error occured
System.Xml.XmlException: 'umbraco' is an undeclared namespace. Line 24, position 4. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String arg, Int32 lineNo, Int32 linePos) at System.Xml.XmlTextReaderImpl.LookupNamespace(NodeData node) at System.Xml.XmlTextReaderImpl.ElementNamespaceLookup() at System.Xml.XmlTextReaderImpl.ParseAttributes() at System.Xml.XmlTextReaderImpl.ParseElement() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.Xsl.Xslt.XsltInput.ReadNextSiblingHelper() at System.Xml.Xsl.Xslt.XsltInput.ReadNextSibling() at System.Xml.Xsl.Xslt.XsltInput.MoveToNextSibling() at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags) at System.Xml.Xsl.Xslt.XsltLoader.XslIf() at System.Xml.Xsl.Xslt.XsltLoader.XslChoose() at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags) at System.Xml.Xsl.Xslt.XsltLoader.LoadTemplate(NsDecl stylesheetNsList) at System.Xml.Xsl.Xslt.XsltLoader.LoadRealStylesheet() at System.Xml.Xsl.Xslt.XsltLoader.LoadDocument() at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)
Thank you. I'll try your suggestion. BTW, I was wondering where to get the Template ID number. Like the one on this "2388" Sorry, I know very very little in .net and xslt, im more on the designing part.
Goto the developer-section in umbraco. Then goto the templates-tree. If you hover your mouse over the template in the tree (on the left-side), then you'll see the template-number appearing in your browsers status-bar at the bottom.
Wrapping a user control inside a xslt condition
Hi,
I'm trying to restrict posting comments on blog for umbraco by using xslt to check if the user is logged in or not. Inside the xslt if condition i inserted the umbraco macro for posting comments on the blog. I received an error that says.
Here is my xslt file.
Hi,
you cannot use umbraco:Macro directly in xslt, hence the error.
You can use umbraco.library:RenderMacroContent however. See here for an example:
http://web-garden.co.uk/2008/7/30/passing-parameters-to-rendermacrocontent.aspx
HTH,
Peter
Hi Peter,
Thank you. I'll try your suggestion. BTW, I was wondering where to get the Template ID number. Like the one on this "2388" Sorry, I know very very little in .net and xslt, im more on the designing part.
<xsl:variable name="loggedOutTemplate" select="2388" />
Goto the developer-section in umbraco. Then goto the templates-tree. If you hover your mouse over the template in the tree (on the left-side), then you'll see the template-number appearing in your browsers status-bar at the bottom.
HTH,
Peter
Thank you so much Peter! :D
is working on a reply...