Anders Hattestad
Sep 21, 2010
  6560
(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
Opti ID overview

Opti ID allows you to log in once and switch between Optimizely products using Okta, Entra ID, or a local account. You can also manage all your use...

K Khan | Jul 26, 2024

Getting Started with Optimizely SaaS using Next.js Starter App - Extend a component - Part 3

This is the final part of our Optimizely SaaS CMS proof-of-concept (POC) blog series. In this post, we'll dive into extending a component within th...

Raghavendra Murthy | Jul 23, 2024 | Syndicated blog

Optimizely Graph – Faceting with Geta Categories

Overview As Optimizely Graph (and Content Cloud SaaS) makes its global debut, it is known that there are going to be some bugs and quirks. One of t...

Eric Markson | Jul 22, 2024 | Syndicated blog

Integration Bynder (DAM) with Optimizely

Bynder is a comprehensive digital asset management (DAM) platform that enables businesses to efficiently manage, store, organize, and share their...

Sanjay Kumar | Jul 22, 2024

Frontend Hosting for SaaS CMS Solutions

Introduction Now that CMS SaaS Core has gone into general availability, it is a good time to start discussing where to host the head. SaaS Core is...

Minesh Shah (Netcel) | Jul 20, 2024

Optimizely London Dev Meetup 11th July 2024

On 11th July 2024 in London Niteco and Netcel along with Optimizely ran the London Developer meetup. There was an great agenda of talks that we put...

Scott Reed | Jul 19, 2024