I'm pretty sure your newsType value isn't an attribute (prefixed with @), but an element. In which case it would be
//NewsItem[newsType=83]
or
//NewsItem[newsType='General']
(Notice the single quotes when comparing strings)
I recommend installing the XPath navigator extension to Visual Studio if you're using VS. You can search by xpath in /App_Data/umbraco.config. It makes it a breeze finding the correct xpath expression.
Drop Down List Data Type and Content By XPath
Hi All,
I have a property on my document that is a Dropdown List I am trying to work out how to get content by XPath with either the value or id of an item.
For Example
Or
Best Regards, L
I'm pretty sure your newsType value isn't an attribute (prefixed with @), but an element. In which case it would be
or
(Notice the single quotes when comparing strings)
I recommend installing the XPath navigator extension to Visual Studio if you're using VS. You can search by xpath in /App_Data/umbraco.config. It makes it a breeze finding the correct xpath expression.
Hi Lars,
I had put the @ in the post but it was not part of my code. It was because of the single quotes - thank you kindly.
And thank you for the VS plugin link.
And just so people know - it is the text string that you use not the id.
Regards, L
is working on a reply...