Very new to Umbraco and .net, have been getting on fairly well putting my first site together. However, I've hit a bit of a stumbling block where I have set up a document type called Testimonial Article, which I want to retrieve and loop through in the XSLT file. I have set up a Macro which is linked to this XSLT file, and I've created and published a Testimonial Article - but there is no results seemingly.
I am assuming I am trying to access the document type incorrectly in the XSLT file?
I just updated the GetXmlAll() page to be of a little more help to newcomers looking up what to do. Basically, you don't need it from XSLT - there's a couple of examples of how to do what I've typically seen people do, but with straight XPath instead. Hope it helps - otherwise, come back here :-)
Also, Charles' tip on viewing the XML can be very helpful to get a grasp on how the data is structured for use in your macros.
I created a package for making that particular thing a bit easier: XML Dump makes it easy to view and query the XML directly from the browser's address bar.
Retrieving document types in xslt file in umbraco
Very new to Umbraco and .net, have been getting on fairly well putting my first site together. However, I've hit a bit of a stumbling block where I have set up a document type called Testimonial Article, which I want to retrieve and loop through in the XSLT file. I have set up a Macro which is linked to this XSLT file, and I've created and published a Testimonial Article - but there is no results seemingly.
I am assuming I am trying to access the document type incorrectly in the XSLT file?
In Testimonials.xslt, very basic:
Hi, What properties are you trying to access on Testimonal Article? and why are you trying to get all of the xml at once?
If you just want to get a value from a property for say a textstring just do <xsl:value-of select=$currentPage/nodeproperty></xsl>
$currentPage is the node you are currently at and nodeProperty is the alias of the property you are trying to access.
hope this helps. If you are trying to get xml of a particualr doc type let me know and i will give you some code :)
you can see all of the XML markup for a page by doing <textarea><xsl:copy-of="$currentPage"></xsl:copy-of></textarea>
Hi bsod99,
I just updated the GetXmlAll() page to be of a little more help to newcomers looking up what to do. Basically, you don't need it from XSLT - there's a couple of examples of how to do what I've typically seen people do, but with straight XPath instead. Hope it helps - otherwise, come back here :-)
Also, Charles' tip on viewing the XML can be very helpful to get a grasp on how the data is structured for use in your macros.
I created a package for making that particular thing a bit easier: XML Dump makes it easy to view and query the XML directly from the browser's address bar.
/Chriztian
is working on a reply...
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.