I created an xslt which contain the following: <! - Start writing XSLT -> <xsl:value-of select="$currentPage/@nodeName"/> <br/> <br/> Text: <xsl:value-of select="$currentPage/data[@alias='website']/text()"/>
There is automatically created a macro.
Under Settings, I've created a Document Type (plaintext) where I've created a property with the following: Name: Website Alias: website Type: Richtext editor Tab: content
On my page under the tab "content", I have added some text.
And on my template (under Setings), I have added my macro. Looking like this: <%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
Also, 4.5.1 uses the new XML schema, so the XSLT examples you were looking at are slightly out of date (for older version of Umbraco, 4.0.x). Here's a reference how to use the new schema with some example:
Need help making macro works
Hello
I need a little help with something I think is very basic in umbraco.
I'm reading this article: http://umbraco.org/documentation/books/xslt-basics/what-is-xslt and follow his examples. I just can't get it to work :-(
I created an xslt which contain the following:
<! - Start writing XSLT ->
<xsl:value-of select="$currentPage/@nodeName"/> <br/> <br/>
Text: <xsl:value-of select="$currentPage/data[@alias='website']/text()"/>
There is automatically created a macro.
Under Settings, I've created a Document Type (plaintext) where I've created a property with the following:
Name: Website
Alias: website
Type: Richtext editor
Tab: content
On my page under the tab "content", I have added some text.
And on my template (under Setings), I have added my macro. Looking like this:
<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
<umbraco:Macro Alias="Xxx" runat="server"></umbraco:Macro>
</asp:Content>
My problem is that I dont get any text displayed on the page.
What am I doing wrong?
Am I missing some settings?
I look forward to hearing your reply.
Hi Kate,
Which version of Umbraco are you using?
Regards,
Bijesh
I´m using umbraco v 4.5.1
You might to check what template your document type is using and make sure that your content page has the template set under Properties tab
I think all that is okay, because in my xslt I have written the word "Text" and that is displayed on my page.
Also, 4.5.1 uses the new XML schema, so the XSLT examples you were looking at are slightly out of date (for older version of Umbraco, 4.0.x). Here's a reference how to use the new schema with some example:
http://our.umbraco.org/wiki/reference/xslt/45-xml-schema/xslt-examples-updated-to-new-schema
thanks
I will have a look at it and then I will probably get back to you :-)
I found this:
but ofcause it gives me an error.
The "$myMacroParameter" I don´t know what to do with.
Is there some settings I need to change in the Macro
And what about [name(). What does that means?
So, instead of:
Try:
It works - kind of :-)
It writes my html on the page as well:
http://shiftumbraco.planetshift.dk/1313.aspx
Ah, add disable-output-escaping - so it would be
Jubii, it works
So I dont have to think about if it is at Node or Data that Im getting my data from?
Thanks for your help
Glad you got it working :)
Using the new XML schema makes it easier to work with.
is working on a reply...