Dynamic content widgets

Once you create and activate a dynamic module, Sitefinity CMS automatically creates a Dynamic content widget. You can see the widget in the Content widget group. 

After you drop the Dynamic content widget on your page, you must configure it to display content types.

The following tutorial displays a dynamic content type, named Countries.

PREREQUISITES: You created at least one dynamic content type. For more information, see Dynamic modules.

Choose what content to display

You choose what dynamic content to display in the Content tab page of the widget designer.

  1. 1.In the upper-right corner of the Dynamic content widget, click the Edit button .
  2. 2.Under Which countries to display?, choose which dynamic items you want to display:
    • All published countries
      All created items are displayed.
    • Selected countries
      Custom selection of one or more dynamic content items.
    • Narrow selection by...
      Narrow down the number of dynamic content items displayed using dates. Select one of the predefined time intervals, so that dynamic content items created during that interval are displayed or choose Custom range… and select a time interval.

List settings

List settings define how dynamic content, in this case countries, are listed and displayed by the widget.

  • Use paging
    Divides the list of countries into pages. In the input field, specify how many countries per page you want displayed.

  • Use limit
    Displays only a limited number of countries. In the input field, specify how many countries you want displayed.

  • No limit and paging
    Displays all countries that you selected in the Content tab page.

  • Sort countries
    Select a sorting criterion for listing the countries:

    • Last published
      This option is selected by default.
    • Last modified
    • By Title (A-Z)
    • By Title (Z-A)
    • As set manually
      This option is available only if you used the Selected countries… option in the Content tab page. If you select the As set manually option, countries are displayed in the order as they are listed in the Content tab page.
    • As set in Advanced mode
      To sort dynamic content items by property that is not displayed in the sort dropdown menu, you must add a new sorting expression in the widget designer’s Advanced mode.
      For example, if you want to sort countries by their Content property, click Advanced » Model and in SortExpression, enter Content ASC. As a result, in the sort dropdown menu, the As set in Advanced mode option is selected by default.
  • List template
    Select the template you want to use to display the list of countries on the page.

  • CSS classes
    Apply additional CSS classes to the Dynamic content widget by expanding More options and specifying the CSS class names.

Single item settings

Single item settings define how individual dynamic content items, in this case countries, are displayed on the page. Choose one of the following options:

  • Open single item in...
    Select one of the following:

    • Auto-generated page
      When you click a dynamic content item, it is displayed in an automatically generated page that has the same layout as the list page.

    • Selected existing page…
      Select a page from the list of existing pages that has the desired layout. When you click on the dynamic content item, it is displayed in this specific page.

      NOTE:  The page on which you want the dynamic content item displayed, must have a Dynamic content widget added.

  • Detail template
    Select the template you want to use to display the dynamic content items on the page.

  • CSS classes
    Apply additional CSS classes to the Dynamic content widget by expanding More options and specifying the CSS class names.

Advanced settings

In Advanced settings, you specify additional widget properties.

  • DetailsPageId
    Gets the ID of the page you selected under Selected existing page... option in the Single item settings tab page.

  • DetailTemplateName
    Gets the template you chose in Detail template dropdown menu in the Single item settings tab page.

  • ListTemplateName
    Gets the template you chose in the List template dropdown menu in the List settings tab page.

  • OpenInSamePage
    Specifies whether when clicking on the dynamic content item to open its detail view in a new window when. The default value is false.

Model settings

Model settings include all properties directly bound to the widget model. You access these properties by clicking the Model button in Advanced settings. There, you can modify the following properties:

  • CurrentlyOpenParentType
    In case you created hierarchical module, in the child widget's property grid, the system automatically displays the parent module type.

  • DetailCssClass
    Gets and sets an additional CSS class to the details view.

  • DisableCanonicalUrlMetaTag
    Sets a rel="canonical" meta tag to the dynamic content items.

  • DisplayMode
    Gets the value you selected in the Simple List settings tab page. Choose one of the following options:

    • Paging
      This option is selected by default.
    • Limit
    • All
  • FilterExpression
    Filters dynamic content items based on an additional filter expression.

  • ItemsPerPage
    Defines the number of dynamic content items per page when paging is enabled. The default value is 20.

  • ListCssClass
    Gets and sets an additional CSS class to the list view.

  • ListMode

  • ParentFilterMode

  • ProviderName
    If you added more than one providers for dynamic content items, you can use a non-default provider by specifying its name. If you leave this property value empty, the default provider is used.

  • RelatedFieldName
    Gets the option you selected in the Content tab page. The possible values are:

    • AllItems

    • SelectedItems

    • FilteredItems

  • RelatedItemProviderName
    The name of the provider that the related data uses.

  • RelatedItemType

  • RelationTypeToDisplay
    The relation type specifies whether related items are children or parents of the source item.

  • SelectionMode

  • SerializedAdditionalFilters
    In case dynamic content items are filtered based on a date, tags, or categories, the IDs of the selected filter criteria are serialized and populated in this field.

  • SerializedSelectedItemsIds
    In case you specifically selected dynamic content items, the IDs of the selected items are serialized and populated in this field.
    For example: ["3g47d0b8-2d22-6e58-888c-ff0000bfc4e0"]

  • SerializedSelectedParentsIds
    In case you specifically selected dynamic content items based on their parent, the IDs of the selected parent items are serialized and populated in this field.
    For example: ["3e47d0b8-2d22-6e58-888c-ff0000bfc4e0"]

  • ShowListViewOnEmptyParentFilter

  • SortExpression
    Adds an additional sorting expression for the dynamic content items. The default value is PublicationDate DESC

  • UrlKeyPrefix
    Gets or sets the URL key prefix. Used when building or evaluating URLs for paging and filtering.


Tags

Was this article helpful?