I have an DynamicPublishedContentList that is returning among other things the node id of a related content node.
I need to filter this result set based on a value inside a property contained in the related node. While not ideal, I would like to iterate through the DynamicPublishedContentList and either create a temp value containing this related property value so that I can then bind my UI output to this updated DynamicPublishedContentList and sort by the value of the related property value. Is this possible? If not, can anyone provide any suggestions on a better approach?
Something like this...
var baseSelection = startNode.Descendants(documentTypeAlias)
var tempSelection = new DynamicPublishedContentList(selection);
foreach (var tempItem in selection)
{
//now resolve related content id to a node and retrieve its property value and assign to a new value in the collection OR update existing value
tempItem.Add("testproperty", "test");
}
Thanks Alex - I created another post that more accurately describes the scenario. If you can take a look that would be great - any sample linq code would be greatly appreciated.
Updating values inside DynamicPublishedContentList
I have an DynamicPublishedContentList that is returning among other things the node id of a related content node.
I need to filter this result set based on a value inside a property contained in the related node. While not ideal, I would like to iterate through the DynamicPublishedContentList and either create a temp value containing this related property value so that I can then bind my UI output to this updated DynamicPublishedContentList and sort by the value of the related property value. Is this possible? If not, can anyone provide any suggestions on a better approach?
Something like this...
Thanks in advance!
Jamie
Hi Jamie,
Can you use strongly typed models? If you avoid using dynamics - you will be able to make filtering really easy.
Thanks,
Alex
Thanks Alex - I created another post that more accurately describes the scenario. If you can take a look that would be great - any sample linq code would be greatly appreciated.
https://our.umbraco.org/forum/templates-partial-views-and-macros/79665-using-nupicker-value-inside-orderby-clause
Cheers,
Jamie
is working on a reply...