Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,I need to get a list of 'Promo Boxes' from where ever I am on the site.
More specifically, from any page I need to iterate through any docType "promoBox" which sits under the docType 'promoBoxesRight'
Here's the structure:Home-About Us-Contact Us-Promo Boxes - Promo Boxes Right - Promo Box 1 - Promo Box 2 - Promo Boxes Center - Promo Box 3 - Promo Box 4Pseudo code would read something like: //Home/nodeTypeAlias ="PromoBoxRight"/nodeTypeAlias ="promoBox"The 'Promo Boxes' docType has 'UmbracoNaviHide' set to true.Many thanks,Rich
Try
<xsl:for-each select="$currentPage/ancestor-or-self::node{@level=1]//node[@nodeTypeAlias='promoBoxRight']//node[@alias='promoBox']"> // whatever</xsl:for-each>
The syntax // means all child nodes. 'ancestor-or-self' allows you to search up the node structure.
The above syntax ignores 'UmbracoNaviHide', so you'll need to add it in if you need it.
Check out the subpages of http://our.umbraco.org/wiki/reference/xslt for more tips and examples.
Cheers,
Chris
Thanks Chris, that worked a treat.
The only weird thing is that nothing would work until I deleted and recreated my document types.
Thanks again.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
List of a specific doctype from anywhere in site
Hi,
I need to get a list of 'Promo Boxes' from where ever I am on the site.
More specifically, from any page I need to iterate through any docType "promoBox" which sits under the docType 'promoBoxesRight'
Here's the structure:
Home
-About Us
-Contact Us
-Promo Boxes
- Promo Boxes Right
- Promo Box 1
- Promo Box 2
- Promo Boxes Center
- Promo Box 3
- Promo Box 4
Pseudo code would read something like:
//Home/nodeTypeAlias ="PromoBoxRight"/nodeTypeAlias ="promoBox"
The 'Promo Boxes' docType has 'UmbracoNaviHide' set to true.
Many thanks,
Rich
Try
The syntax // means all child nodes. 'ancestor-or-self' allows you to search up the node structure.
The above syntax ignores 'UmbracoNaviHide', so you'll need to add it in if you need it.
Check out the subpages of http://our.umbraco.org/wiki/reference/xslt for more tips and examples.
Cheers,
Chris
Thanks Chris, that worked a treat.
The only weird thing is that nothing would work until I deleted and recreated my document types.
Thanks again.
is working on a reply...