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
What is the proper way to refer to ancestor-or-self with the new 4.5 schema? The old version is:
$currentPage/ancestor-or-self::node/data [@alias = 'metaKeywords']
I think it would be:
$currentPage/ancestor-or-self::metaKeywords
Not getting any results.
Hi Connie,
If you know the nodeTypeAlias (e.g. 'Textpage') of your document type, you should use that:
$currentPage/ancestor-or-self::Textpage/metaKeywords
Otherwise, use the more generic:
$currentPage/ancestor-or-self::*[@isDoc]/metaKeywords
/Chriztian
All of the above should work, but are not. Gotta be missing something.
<xsl:attribute name="content"> <xsl:value-of select="$currentPage/ancestor-or-self::* /metaKeywords" disable-output-escaping="yes"/></xsl:attribute>
This could be related to a question I just wrote a loooong answer for... try this:
<xsl:attribute name="content"> <xsl:value-of select="$currentPage/ancestor-or-self::*[metaKeywords[normalize-space()]][1]/metaKeywords" /> </xsl:attribute>
This will take the metaKeywords property on the closest ancestor that actually has a value set for it.
That works! When you have time, it would be nice to know why.
Thanks!
Great - that's good!
The answer I mentioned is right here: http://our.umbraco.org/forum/developers/xslt/10934-XSLT-fails-after-publish?p=0#comment40836
or you might want try a text() !='' test as in:
<xsl:attribute name="content"> <xsl:value-of select="$currentPage/ancestor-or-self::metaKeywords[text() !='']"/></xsl:attribute>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
ancestor-or-self with new schema
What is the proper way to refer to ancestor-or-self with the new 4.5 schema? The old version is:
$currentPage/ancestor-or-self::node/data [@alias = 'metaKeywords']
I think it would be:
$currentPage/ancestor-or-self::metaKeywords
Not getting any results.
Hi Connie,
If you know the nodeTypeAlias (e.g. 'Textpage') of your document type, you should use that:
Otherwise, use the more generic:
/Chriztian
All of the above should work, but are not. Gotta be missing something.
Hi Connie,
This could be related to a question I just wrote a loooong answer for... try this:
This will take the metaKeywords property on the closest ancestor that actually has a value set for it.
/Chriztian
That works! When you have time, it would be nice to know why.
Thanks!
Great - that's good!
The answer I mentioned is right here: http://our.umbraco.org/forum/developers/xslt/10934-XSLT-fails-after-publish?p=0#comment40836
/Chriztian
or you might want try a text() !='' test as in:
is working on a reply...