Item Publisher

The Item Publisher module is only a small part of working with items in Dynamicweb. You should familiarize yourself with items in general, before reading this section.

With the item publisher module, you can publish items on the frontend.

Using this module, you can:

  • Select a type of item to publish
  • Control how the items are displayed on the frontend
  • Set up filters, to further control which items to publish
  • Enable or disable frontend-editing of items

 

You need to enable Prototype in Management Center – Solution settings to get the Item publisher module to work properly in frontend

manual

Before using the item publisher module, you need to have one or more item types defined, and you need to have one or more items created.

In this section, you will learn about:

  • Adding the item publisher module to a paragraph
  • Selecting which items to publish
  • Controlling how you display items in list view & details view
  • Setting up filters, to further control which items to publish
  • Enabling front-end editing of list fields

To get started with the Item Publisher, add the module to a paragraph on a page. Read about adding modules to a paragraph.

From the paragraph, you have access to the module settings window (Figure 3.1).

From here, you can control the behavior of this instance of the module - or remove it altogether.

Here’s a rundown of the settings and what they do.

Figure 3.1 The module settings window

We strongly discourage you from creating new sites using stylesheets, Javascript, or the theme-functionality. This is old technology, and is supported for legacy reasons.

The data settings control which items and item fields you publish.

Figure 4.1 The Item Publisher data settings

Here you can:

  • Select the item type you want to publish
  • Select the area you want to publish items from. Your options are:
    • Select items from this language/area – publish items from a specific website
    • Select items from current language/area – publish items from the website with the module attached
    • Select items under the current page – publish all items under current page (the page with the module attached)
    • Select items under the following pages – publish items from one or more pages.
    • Select specific item(s) – publish specific items from the item repository.
    • Named item list – publish items from a named item list
  • Include paragraph items – also publish the paragraph items belonging to the pages you publish
  • Include child items – publish all items (children, grandchildren, and so on) under the selected page/website.
  • Include inherited items – publish all items inherited from a base item type. Available from 8.6.1.0
  • Show login for restricted items – list restricted pages, but require login for accessing the details
  • Item fields – lists: Specify which item fields you want to show in the list view when publishing items
  • Item fields – details: Specify which item fields you want to show in the details view when publishing items

By default, the item publisher will only publish items which are one level below the page with the item publisher module on. Check the include all child items to publish items from futher down the content tree.

Page content from the page with the module attached is excluded - but item based paragraphs can be published by checking the include paragraph items checkbox.

The list settings (Figure 5.1) control how you display the list view of the items you publish.

Figure 5.1 The Item Publisher list settings

Here you can:

  • Select the template you want to use for the list view. We provide you with a table-based template and a div-based template, but you can create or modify them to your liking.
  • Select how to order the list, by specifying the field to order by, and selecting ascending or descending ordering
  • Select you list view type
    • Normal provides you with ordinary paging. Write the number of items you want on a page in the Page Size field.
    • Partial provides you with the option of selecting a partial list of items to show – enter the item to start from in the item from and the item to end with in item to field

The details settings (Figure 6.1) control how you display the details view of the items you publish.

Figure 6.1 The Item Publisher details settings

With the details settings, you can:

  • Select the template you want to use for the details view. Dynamicweb provides you with a standard template, but you can create your own templates or modify them to your liking
  • Specify the paragraph you want to display the details view in, when a user clicks view or edit on an item – the selected paragraph needs to also have the item publisher module attached, with the same item type selected. Available from 8.5.0.1

With filtering settings, you can set up conditions (rules) in order to further control which items to publish.

Figure 7.1 You can filter the items before publication by creating filtering rules

To set up a rule:

  • Click add new rule
  • Choose a field to filter on
  • Add a condition and a value to test for
    • Conditions available: is/is not, contains/does not contain, starts with/does not start with, and ends with/does not end with

You may choose between the operators AND and OR when combining your filtering rules.

WIth the edit settings, you can enable frontend editing of item fields published.

Figure 8.1 Enable frontend editing of item fields by using these settings

To do so:

  • Enable editing of item fields in the frontend
  • Select the template you want to use for the edit page

If frontend editing is enabled, you can customize the error messages you show to users, if they try to save empty or invalidly formatted field entries.

Figure 8.2 Customize your error messages with these settings

To do so:

  • Specify the error message on an incorrect field value used
  • Specify the error message on an empty field

Read about item types and field types to learn how to make an item field required, and how to introduce validation on an item field.

implementing

In this section, you will learn about:

  • Query string filtering
  • Rendering items directly in a template

The Item Publisher supports query string filtering from 8.5.0.0 and forward.

System type string fields can be filtered using the following operators: 

Example Filtering effect
Name=Razor Exact match
Name=t* Starts with
Name=t* Contains
Name=*t Ends with

 

System type numeric fields can be filtered using the following operators:

Example Filtering effect
Number=10 equals
Number=10&Number.op== equals (operator specified)
Number=10&Number.op==eq equals (operator specified)
Number=10&Number.op=!= not equal to
Number=10&Number.op=<>  not equal to
Number=10&Number.op=< less than
Number=10&Number.op=<= less than or equal to
Number=10&Number.op=> greater than
Number=10&Number.op=>= greater than or equal to
Number.from=10&Number.to=20 range (explicit)
Number=10-20 range (implicit)
 

 

System type double fields can be filtered using the following operators:

Example Filtering effect
Double=0&Double.op=lt less than
Double=0&Double.op=gt greater than

 

System type date fields can be filtered using the following operators:

Example Filtering effect
DateAndTime=2014-08-01 equal
DateAndTime=2014-08-01&DateAndTime.op=<  before
DateAndTime=2014-08-01&DateAndTime.op=lt  before
DateAndTime=2014-08-01&DateAndTime.op=> after
DateAndTime=2014-08-01&DateAndTime.op=gt after
 

From Dynamicweb 8.5.1.0 the Item publisher supports &PID= in the query string, allowing you to filter on page ID.

The Item publisher extension tags - Item.Render/RenderItem() & Item.RenderList/RenderItemList() - are methods to render an item directly in a template without the use of a page or paragraph.

For example:

Example 1: string DataFromItem = RenderItemList(new { ItemType = "NameOfMyItem", ListSourceType = SelfPage, ListSourcePage = "3223", ItemFieldsList = "*", ListTemplate = "ItemPublisher/ListMyItems.cshtml", ListPageSize = "100", }); @DataFromItem Example 2 - Multiple SourcePages string DataFromItem = RenderItemList(new { ItemType = "NameOfMyItem", ListSourceType = SelfPage, ListSourcePage = "3223, 1432, 3421", ItemFieldsList = "*", ListTemplate = "ItemPublisher/ListMyItems.cshtml", ListPageSize = "100", }); @DataFromItem

The following parameters are available to you when using the tags:

 

Property

Description

Type

Condition

Default

Possible values

ItemType

A specific item type that you use for pages. The item fields from the selected item type is published in frontend.

string

Mandatory

 

Item type system name

ListSourceType

Source to render item publisher list

string

Optional

ItemEntry

Area,
Page,
SelfPage,
ItemEntry,
ItemEntries

ListSourceArea

ID of a specific website to take data from all published content based on the ItemType

string

Mandatory if ListSourceType=Area

 

ListSourceArea:10; 

ListSourcePage

ID of one or multiple pages divided by semicolon to take data from the published content based on the ItemType under this/these pages 

CSV string of page ID’s

Mandatory if ListSourceType=Page

 

ListSourcePage:313,298;

SourceItemEntries

ID of one or multiple specific item type used for content. 

CSV string of tem ID’s

Mandatory if ListSourceType=ItemEntries

 

SourceItemEntries:3,9;

ItemFieldsList

Defines field set to render

CSV string 

Mandatory if ListSourceType is Area, Page, SelfPage or ItemEntries

 

ItemFieldsList:Fld1,Fld2;
ItemFieldsList:*; to take all fiels

ListTemplate

Defines template to render frontend 

string

Mandatory if ItemFieldsList is used

 

ListTemplate:ItemPublisher/List/List.html;

ListOrderBy

Allows to order by a specific field via its system name. You can also use Sort value which is the order that the pages are sorted in the menu tree or Created/Updated value to order the list by date creation/updating 

string

Optional

Created

ListOrderBy:FldName;
ListOrderBy:Sort;
ListOrderBy:Created;
ListOrderBy:Updated;

ListOrderByDirection

Defines that order should be Ascending or Descending

string

Optional

Ascending 

Ascending, Descending

ListViewMode

Defines ordinary paging or a partial list of items

string

Optional

Normal

Normal, Partial

ListShowFrom

Defines ‘from’ item in the partial list

number

Mandatory if ListViewMode=Partial

1

ListShowFrom:1;

ListShowTo

Defines ‘to’ item in the partial list

number

Mandatory if ListViewMode=Partial

End item

ListShowTo:6;

ListPageSize

Defines list paging, parameter value is item quantity on page

number

Mandatory if ListSourceType is enabled

All items

ListPageSize:10;

IncludeParagraphItems

This will publish items of the defined type that are paragraphs as well as pages.

boolean

Optional

False

IncludeParagraphItems:True;

IncludeAllChildItems

This will return all pages (children, grandchildren and so on) under the defined source

Optional

 

False

IncludeAllChildItems:False;

ShowSecurityItems

Allows to show items gathered within content under security 

boolean

Optional

False

ShowSecurityItems:True;

SourceItemEntry

Defines to render data from specific item (ID) used within a content

number

Mandatory if ListSourceType is ItemEntry(not specified)

 

SourceItemEntry:9;

ItemFields

Allows to specify item field set 

CSV string

Mandatory with SourceItemEntry

 

ItemFields:FieldName1. FieldName2;
ItemFields:*;

DetailsTemplate

Defines template to render te itementry

string

Mandatory with SourceItemEntry 

 

DetailsTemplate:ItemPublisher/Details/Details.html;

development

There is no developing specific information for this subject.

database

There is no database specific information for this subject.

integration

There is no integration specific information for this subject.