Question

I'm using Sitecore. I want to get the full name/description of a DMS rule in programcode by Sitecore ID, for example: "Where the DayOfWeek has a value that is equal to Tuesday".

Who knows how to do this?

Thanks a lot.

Jordy

Was it helpful?

Solution

I don't know of a simple way, but the class responsible for rendering the rule text is Sitecore.Shell.Applications.Rules.RulesRenderer in Sitecore.Client.dll.

Its constructor accepts the XML from a rules field and you call the Render method, passing in a prepared HtmlTexteWriter. It also has a bunch of fairly self-explanatory private methods like RenderRule, RenderCondition etc.

I'm sure if you decompile that class you can pick out the bits you need.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top