Anders Hattestad
Sep 21, 2010
  6653
(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
PageCriteriaQueryService builder with Blazor and MudBlazor

This might be a stupid idea but my new years resolution was to do / test more stuff so here goes. This razor component allows users to build and...

Per Nergård (MVP) | Feb 10, 2025

Enhancing Optimizely CMS Multi-Site Architecture with Structured Isolation

The main challenge of building an Optimizely CMS website is to think about its multi site capabilities up front. Making adjustment after the fact c...

David Drouin-Prince | Feb 9, 2025 | Syndicated blog

How to: set access right to folders

Today I stumped upon this question Solution for Handling File Upload Permissions in Episerver CMS 12, and there is a simple solution for that Using...

Quan Mai | Feb 7, 2025 | Syndicated blog

Poking around in the new Visual Builder and the SaaS CMS

Early findings from using a SaaS CMS instance and the new Visual Builder grids.

Johan Kronberg | Feb 7, 2025 | Syndicated blog