Basically the currentPage variable contains all the xml from node where your XSLT is being executed and its child elements such as when you make use of ancestors etc.
thank you for your email, the code you gave me doesn't work for me, but at least, i got some understanding of what info is in "currentPage".
I believe either there's something wrong in my code, or maybe the way my nodes are configured? Maybe I miss a reserence or something?
Anyway, here is my code (sorry, I don't know the tags to separate the code from the rest of the post) :
EDIT : any code I post is unreadable, what tags should I use? I tried [code][/code]
Thank you for your help,
F
EDIT : this seems to work :
Now i'm glad I got it to work, but this is mere copy/paste from the siteMap macro. Can anyone take some time to explain a newbie why this syntax works and not the others I used?
Problem understanding and using "$currentPage"
Hello,
I have the folowing structure for my website :
+Home
+Blog1
+Post1
+Post2
+Blog2
+Post1
+Post2
+Page1
On Page1 I'm trying to retrieve informations about Blog1 and blog2, but here is a strange thing :
$currentPage/@level gets me "2", which is normal (level 2 page)
BUT
$currentPage/ancestor-or-self, or $currentPage/parent, or even $currentPage/self get me nothing.
Is there anything I'm doing wrong?
Thank you,
F
Hi there,
Basically the currentPage variable contains all the xml from node where your XSLT is being executed and its child elements such as when you make use of ancestors etc.
I think this might work for you though
Hello,
thank you for your email, the code you gave me doesn't work for me, but at least, i got some understanding of what info is in "currentPage".
I believe either there's something wrong in my code, or maybe the way my nodes are configured? Maybe I miss a reserence or something?
Anyway, here is my code (sorry, I don't know the tags to separate the code from the rest of the post) :
EDIT : any code I post is unreadable, what tags should I use? I tried [code][/code]
Thank you for your help,
F
EDIT : this seems to work :
Now i'm glad I got it to work, but this is mere copy/paste from the siteMap macro. Can anyone take some time to explain a newbie why this syntax works and not the others I used?
Thanks,
F
Hi F (unique name) :)
I am considering you are using, umbraco version above 4.5 (which uses new schema) and Page1 and Blog1 are different doc type.
Replace the BlogDocTypeAliasName with the actual blog doc-type alias name..
<xsl:for-each select="$currentPage/ancestor-or-self::BlogDocTypeAliasName[@isDoc and @level = 2]">
<xsl:value-of select="."/>
</xsl:for-each>
Thanks,
That works well, and helped me understand how to getto blogPost, or any other type of content for that matter.
Thanks again,
F.
is working on a reply...