0
votes

I have a Rich Text Field inside an item template that includes Text.How to retrieve that field value using Xpath Query.

/sitecore/content/Home/Data/Common Data/CommonDescription.

By using this Query I'm able to access Item.But my Question is how to access field inside that item using Xpath Query.

1

1 Answers

3
votes

I don't believe you can get the field values and path is designed to retrieve items rather than field values.

Once you have the item you will then be able to get the fields using the api

Item[] items = Sitecore.Context.Database.SelectItems(xpath);

foreach(Item item in items )
{
var richtextfield = item["field"]
...

}