Developer forum

Forum » Feature requests » Items - Field preset

Items - Field preset

Nuno Aguiar
Reply

Hi,

 

Similar to Umbraco's Data Types, would be nice if we could set a field preset. For example.

 

We create a field for "Color scheme", that we need in 5 different Item types. RIght now we need to create the field 5 times.

If we could create a preset of that field, and when creating a new field, instead of choosing 'Color' we could choose our preset "Color scheme". 

 

Best Regards,

Nuno


Replies

 
Mikkel Ricky
Reply
This post has been marked as an answer

We have been discussion the possiblity of including item types in other item types, and I assume this is basically what you want to do. Just to be sure, allow me to give an example of what we're thinking of:

First we create an item type called Address and add item fields Street, Zip code, City, Country. The we create a Person item type, add fields Name and Birthday and include the item type Address. The result will be that Person has its own fields (Name, Birthday) plus the fields from the Address item type.

In Dynamicweb 8.5 we'll introduce item type inheritance. This will make it possible to create a base item type, Person, say, and extend (inherit) this item type to create an Employee item type (with a Department field). An Employee will then inhererit all fields from Person and can have its own fields as well (Department). This is somewhat related to including an item, but still something completely different.

Best regards,
Mikkel

Votes for this answer: 1
 
Nuno Aguiar
Reply

Hi Mikkel,

 

Inheritance makes a lot of sense. I just have some reservations abou the restrictions and definitions, hope it doesn't get too complicated to understand where fields (items) are being allowed/restricted.

 

Also I hope it doesn't get too complicated setting up single fields

 

Best Regards,

Nuno

 
Mikkel Ricky
Reply

It's only item type fields that are inherited. All other item properties are completely controlled by the actual item type itself, i.e. Enable item type for, Allowed in websites, Allowed childred, etc. are not inherited. This helps make things tidy. 

Best regards,
Mikkel

 
Nuno Aguiar
Reply

Hi Mikkel,

 

Considering your answers I created the thread http://developer.dynamicweb-cms.com/forum.aspx?ThreadID=37069.

 

I did not realize that creating items under other items would inherit their fields. That is OK, but then it would not solve my feature request.

 

The idea is to build some fields (unique fields) and use them whenever needed. For example.

  • Color Scheme (preset of 10 colors of the design)
  • Authors (Dropdown list form a SQL query)
  • Themes (checkbox list of types of subjects for news, images, events)

 

The ideia is to use the 3 examples in multiple items with no structure relation to one another:

  • A News Item would use Authors and Themes
  • An Events Item would use Themes
  • A Gallery Item would use Colors and Themes
  • ...

 

If I need to update the Themes options, change the color schemes or update the SQL query I don't have to every item but just the "field/data" type

 

Best Regards,

Nuno

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Another good use case for nested items is an Image. I can have an Image type, with fields like Source, Width, Heught, Alignment etc. With types that can contain other types, I can easily reuse the Image in other types, without the need to duplicate all these settings for each type.

 

Imar

 
Nicolai Høeg Pedersen
Reply

Hi Nuno and Imar

We see the need for this feature. With the release of inheritance in 8.5 and the way it is implemented, this feature is relatively simple to implement as well. We will look at it when we have the experience with inheritance.

Nicolai

 
Christian Rud Skovgaard
Reply

Hi all,

This feature is now a candidate for the 8.6 release.

 

Kind regards

Christian

 
Nuno Aguiar
Reply

Hi Christian,

 

Hope it makes it. I see it as an important feature in configuration for complex/big websites using multiple items.

 

Best Regards,

Nuno