What are items?

Items are custom content containers which can be used for a number of purposes:

  • To create custom content, such as pages and paragraphs used for specific purposes
  • To create custom settings on e.g. websites and pages

Items are created from a kind of template called an item type, which contains a set of fields for storing data and a number of settings for controlling how and where items od this type can be used/created.

Let’s compare items to the (non-item-based) standard paragraph, which consists of:

  • A text field called ParagraphHeader (1)
  • A rich text field called ParagraphText (2)
  • A file field called ParagraphImage (3) and a set of related image settings fields (4)
Figure 1.1 A standard paragraph

In contrast, an item type can have as many fields as you need (Figure 1.2)...

Figure 1.2 An Item type can have as many item fields as you need...

...or indeed as few fields as you need (Figure 1.3).

Figure 1.3 ...or as few!

Items can be used for two things:

  • Creating custom content types, with exactly the fields required for a particular kind of content, e.g. a newsletter, a blog post, etc.
  • Creating custom settings for e.g. websites, pages, users, etc.

Content-focused item types can be restricted, so they are only available on a particular website or as children of another item type, which provides you with many options for creating specialized content structures such as:

  • A page item type called Company which can only have a paragraph item type called Employee as children
  • A page item type called List which can have three types of page items as children; News article, Blog post, or Case
  • A custom paragraph item which allows you to select the width in columns of the paragraph content

Settings-focused item types are used directly on e.g. a website to extend existing settings. Dynamicweb Rapido uses item fields to configure almost everything on the solution (Figure 2.1).

Figure 2.1 Rapido uses website settings to make solutions configurable

Item types are created from the Dynamicweb backend:

  • Go to Settings > Item types
  • Click New Item type and fill in basic settings (name, what it’s going to be used for, etc.)
  • Add any number of item fields – text fields, checkboxes, etc.
  • Define the item restrictions – where the item may be used, which children it can have, etc.
  • Save

Once an item type has been created, it can be immediately used for whatever purpose it has:

  • Content-focused item types can be used to create custom content where the item settings & restrictions permit it.
  • Settings-focused item types can be applied where intended, and values can be entered into the fields and saved

See the Item Types article for a more in-depth explanation.

When content-focused item types, such as Pages or Paragraphs, have been created they are immediately available everywhere specified in the item restrictions.

Simply create a new page or paragraph and select the item type when prompted (Figure 4.1).

Figure 4.1 Creating a content-item

The fields of the selected item type can then be filled out and saved, and you have created an item (Figure 4.2).

Content-focused items can also be created from frontend using the item creator app – and edited using the item publisher app.

Settings-focused item types are used by selecting them using the Item type tool under the regular website settings (Figure 5.1).

Figure 5.1 Using a settings-focused item type

Once selected, the item type fields are available below the regular page or website properties (Figure 5.2).

Figure 5.2 Item fields will appear below the standard website or page properties

Items don’t have to be attached to a paragraph or a page, they may also be stored in an Item List.

Item lists function as a kind of repository for items created from a single item type. They are attached to a page via the Page Properties > Advanced tab, but their items can be published anywhere using the item publisher or query publisher apps.

As always, the item type must be enabled for this type of use – see the item types article for details.

To create an item list on a page:

  • Open the page properties
  • Switch to the advanced tab
  • Click the Item lists button (Figure 6.1)
Figure 6.1 Item lists are created and managed

This opens the item lists interface – where you can create new lists:

  • Click the Add list button
  • Enter Name
  • Select the item type
  • Click OK

When the list has been created you can manage the items therein from the list view (Figure 6.2) – e.g. view, edit, delete or create new items of the chosen item type.

Figure 6.2 Managing items in an item list

Please note, that in many cases editors find it much easier to work with page-items shown in list view.

Items may also be used to extend user groups and users with custom fields. To do so:

  • Create an item type with an appropriate set of fields
  • Enable it for users and/or user groups
  • Open a user or user group
  • Click the Item type button in the ribbon bar and select the item type (Figure 7.1)
  • Click OK
Figure 7.1 User & User group items

When selected at the user level, the user-item only extends that particular user. When selected at the user group level, the user-item extends all users in the user group.

Item field content can be rendered – or reacted to – in frontend whenever you are working in the appropriate context:

  • Website property values are available in the master template (and therefore globally) via Item.Area.* tags
  • Page property values are available in page templates via Item.Page.* tags
  • Field values from content-focused item types are available in page & paragraph templates via Item.* tags

All items can also be published using the Item Publisher app, or the query publisher app provided that a content index has been created and configured.

database

There is no database specific information for this subject.

ItemList

Defines which item type (ItemListItemType) is used for a given item list (ItemListId

Field name Data type Length
ItemListId int 4
ItemListItemType nvarchar 255

ItemListRelation

Links instances of items (ItemListRelationItemId) to an item list (ItemListRelationItemListId) and keeps track of sorting within that item list (ItemListRelationSort).

Field name Data type Length
ItemListRelationId int 4
ItemListRelationItemListId int 4
ItemListRelationItemId nvarchar 255
ItemListRelationSort int 4

ItemNamedItemList

Contains data on named item lists (ItemNamedItemListName) as defined in backend page properties.

Field name Data type Length
ItemNamedItemListId int 4
ItemNamedItemListName nvarchar 255
ItemNamedItemListSourceType nvarchar 50
ItemNamedItemListSourceId bigint 8
ItemNamedItemListItemListId int 4

ItemType_Database

All item types have an ItemType_{SystemName} table associated where {SystemName} = name of item type. Each column represents a field and each row an instance.

Field name Data type Length
Id nvarchar 255
ItemInstanceType nvarchar 255
Description nvarchar Max
Sort bigint 8
TableName nvarchar Max

ItemTypeId

System table for keeping track of id numbering for item types

Field name Data type Length
ItemType nvarchar 255
Current int 4
Seed int 4
ItemTypeIdAutoId int 4

ItemTypeDefinitions

Contains item type definitions on solutions where they are stored in the database rather than as XML-files.

Field name Data type Length
ItemTypeDefinitionsSystemName nvarchar 255
ItemTypeDefinitionsMetadata nvarchar Max
ItemTypeDefinitionsModified datetime 8
ItemTypeDefinitionAutoId int 4