November Happy Hour will be moved to Thursday December 5th.

Anders Hattestad
Sep 21, 2010
  6618
(0 votes)

Dynamicproperties in a tree view

In a project I’m working on we need to view/change/delete some dynamic properties. You can say many things about the edit view of dynamic properties, but I guess most of the statements shouldn't be quoted.

I put some code together that shows one property, and what value it has in a tree view. The code is pretty ugly thou :)

You can select from a dropdown one dynamic property and then hit view. This will show all places where that property has value in a tree view. It’s then possible to mark elements and delete them, or even mark them and change all the marked to a specified value.

image

You have to check the confirm action to actually do the change or delete.

Some code

var list = DynamicProperty.ListTree()

gives a list over all dynamic properties. It is unique by propertyname and page link

if you have one DynamicProperty you can change it’s value and do a .Save() and it will be stored. if you add null as the value it will be deleted.

It’s also possible to set Override=true to change all child elements to use this one.

The code is available here

Sep 21, 2010

Comments

Sep 22, 2010 09:33 AM

Nice work.

Anders Hattestad
Anders Hattestad Sep 22, 2010 10:34 AM

Thanks.
Its a bit dirty, but I only needed it to delete some 3. level dynamic properties that was wrongfull set :)

Please login to comment.
Latest blogs
Optimizely SaaS CMS + Coveo Search Page

Short on time but need a listing feature with filters, pagination, and sorting? Create a fully functional Coveo-powered search page driven by data...

Damian Smutek | Nov 21, 2024 | Syndicated blog

Optimizely SaaS CMS DAM Picker (Interim)

Simplify your Optimizely SaaS CMS workflow with the Interim DAM Picker Chrome extension. Seamlessly integrate your DAM system, streamlining asset...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Optimizely CMS Roadmap

Explore Optimizely CMS's latest roadmap, packed with developer-focused updates. From SaaS speed to Visual Builder enhancements, developer tooling...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Set Default Culture in Optimizely CMS 12

Take control over culture-specific operations like date and time formatting.

Tomas Hensrud Gulla | Nov 15, 2024 | Syndicated blog