London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Anders Hattestad
Sep 21, 2010
  6714
(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 Product Recommendation Troubleshooting

In today’s fast-paced digital landscape, personalization is everything . Customers expect relevant, tailored experiences whenever they interact wit...

Sanjay Kumar | Apr 28, 2025

Natural Language Q&A in Optimizely CMS Using Azure OpenAI and AI Search

In Part 2, we integrated Azure AI Search with Azure Personalizer to build a smarter, user-focused experience in Optimizely CMS. We used ServiceAPI ...

Naveed Ul-Haq | Apr 25, 2025 |

Identifying Spike Requests and Issues in Application Insights

Sometimes within the DXP we see specific Azure App Instances having request spikes causing performance degredation and we need to investigate. I fi...

Scott Reed | Apr 25, 2025

Optimizely Frontend Hosting Beta – Early Thoughts and Key Questions

Optimizely has opened the waitlist for its new Frontend Hosting capability. I’m part of the beta programme, but my invite isn’t due until May, whil...

Minesh Shah (Netcel) | Apr 23, 2025

Developer Meetup - London, 21st May 2025

The London Dev Meetup has been rescheduled for Wednesday, 21st May and will be Candyspace 's first Optimizely Developer Meetup, and the first one...

Gavin_M | Apr 22, 2025

Frontend hosting for PaaS & SaaS CMS

Just announced on the DXP, we FINALLY have a front end hosting solution coming as part of the DXP for modern decoupled solutions in both the PaaS a...

Scott Reed | Apr 22, 2025