Grid Content - Get a simple concatenated string of all rte / text values
Hi,
I've managed to insert the grid content into my Examine index. I'd like to generate and show a preview of the text content in the search results.
I just thought it would be easy to quickly grab the values (where they are RTE or text) and concatenate and strip HTML).
I can't quite get the query right... I've got this far but all I'm selecting is the first row which has an RTE field - I want all "value" fields into an array where the editor-.>alias == rte or text. Has anyone managed to do this?
var jsonGridContent = JObject.Parse(result.GetPropertyValue<string>(field));
var test = jsonGridContent["sections"][0]["rows"].Children()["areas"].Children()["controls"].Where(x => (string)x.Children()["editor"].FirstOrDefault()["alias"].Value<string>() =="rte");
string gridValues = string.Join(" ", test.Values<string>().ToArray<string>());
Grid Content - Get a simple concatenated string of all rte / text values
Hi,
I've managed to insert the grid content into my Examine index. I'd like to generate and show a preview of the text content in the search results.
I just thought it would be easy to quickly grab the values (where they are RTE or text) and concatenate and strip HTML).
I can't quite get the query right... I've got this far but all I'm selecting is the first row which has an RTE field - I want all "value" fields into an array where the editor-.>alias == rte or text. Has anyone managed to do this?
I've seen the rather excellent looking GridData plugin but it looks a bit overkill just for this?? https://github.com/skybrud/Skybrud.Umbraco.GridData
Steve
is working on a reply...