The below code actually works, but I'm trying to modify it so that it pulls in the value of the headline field, not the node name of the articles. I'm sure it's something simple, but I'm a bit new to XSLT.
Each newsArticle node contains a field alias called headline
Im trying to do the same thing.. if you would be willing to answer a few questions for me it would be great:
1) Is 1087 the parent node of the news articles? 2) Is "newsArticle" in "/newsArticle" the name of the parent node? 3) Is "headline" the alias or name of the headline property?
LOL, thanks Matt. When I saw your solution, even before trying it, I gave it the old face palm. I had been trying every sort of syntax scenario except the obvious. But alas, it works, thank you!
Kevon, here's your answers:
1) Yes 2) newsArticle is the alias of the document type for the actual article nodes (which reside directly beneath my news node) 3) headline is the alias of the property, also defined in the document type
the only other thing I need to change is the URL. It should grab the URL of the Item Link: Property which is a content picker. I would like the NiceURL of the Human Resources node selected in the content picker above and not the links of the Billing, Payments, and Purchasing nodes themselves. Any direction appreciated.
How to get custom node property?
The below code actually works, but I'm trying to modify it so that it pulls in the value of the headline field, not the node name of the articles. I'm sure it's something simple, but I'm a bit new to XSLT.
Each newsArticle node contains a field alias called headline
<xsl:for-each select="umbraco.library:GetXmlNodeById(1087)/newsArticle [@isDoc]">
<div class="recentNewsArticle">
<a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a>
</div>
</xsl:for-each>
Thanks for your assitance.
Hey Mike,
Try this
Matt
Im trying to do the same thing.. if you would be willing to answer a few questions for me it would be great:
1) Is 1087 the parent node of the news articles?
2) Is "newsArticle" in "/newsArticle" the name of the parent node?
3) Is "headline" the alias or name of the headline property?
LOL, thanks Matt. When I saw your solution, even before trying it, I gave it the old face palm. I had been trying every sort of syntax scenario except the obvious. But alas, it works, thank you!
Kevon, here's your answers:
1) Yes
2) newsArticle is the alias of the document type for the actual article nodes (which reside directly beneath my news node)
3) headline is the alias of the property, also defined in the document type
Thanks for the answers...
What if the parent node is a different doctype that the child nodes? e.g.
NewsItemContainer (Parent)
NewsItem(child)
will the XSLT still work?
They're actually different document types in my example. I have a news doctype (my parent node) and newsArticle doctypes for my subnode.
Thanks Mike,
I appreciate the response. I'll give it a go.
OK I git this semi-working...this is my node structure, beginning with the Menu Items node ignore DeptHome
this is my XSLT:
the only other thing I need to change is the URL. It should grab the URL of the Item Link: Property which is a content picker. I would like the NiceURL of the Human Resources node selected in the content picker above and not the links of the Billing, Payments, and Purchasing nodes themselves. Any direction appreciated.
Kevon, try changing your code to this:
You might wanna change ItemLink in my code to the alias of that property. When you do that I think it will work for you.
/Kim A
I know this is an old topic, but why is select='headline' not select='@headline'?
Because headline is a actual xml element. You would use @headline when it's a attribute
Dave
How can you tell that it's an xml element or an attribute?
is working on a reply...