Classification widget

Overview

You use the ASP.NET Core Classification built-in widget to display lists of categories, tags, or custom classifications on your website. You then use these lists of classifications to filter the content of the pages.

EXAMPLE: If you have a list of news, some of which are news about the weather and you have tagged them with the tag weather, and some news are about the traffic and you have tagged them with tag traffic, by adding the Tags widget to your page, you give the users the opportunity to filter only traffic or only weather news by clicking the respective tag.

Classifications are created and managed in the Classifications module. You use the widget only to display them.
For more information, see Classify content.

Place the widget on the page

You can place a Classification widget only inside a Section widget.
To do this, perform the following:

  1. Inside a column from the widget, click Add widget here…
  2. Click the Navigation & Search tab.
  3. In the Search and classification section, click the CLASSIFICATION widget.
    The widget is placed inside the selected column of the Section widget.
  4. To open the widget settings, hover over the widget and click Select classification.
    The Classification page opens.

Select content to display

In this section, you choose the classification type to be displayed by the widget.
Perform the following:

Choose content to display

In Classification dropdown box, choose between the built-in Tags and Categories, or any other custom classification that you have on your website.

For more information, see Create custom classifications.

Filter the list of items

In Selection range, you can narrow down the list of classification.
You have different choices, depending on whether you have selected a flat or a hierarchical classification.

  • Flat classifications
    For flat classifications, such as Tags, you can choose between the following:
    • All tags
      All tags are displayed in the list.
    • Selected tags
      A custom selection of tags is displayed.
      To select one or more tags you want to display, click Add (Select tags) button.
    • Only tags used by content type...
      A custom selection of tags is displayed. Only tags assigned to the selected content type items are displayed in the list.

      NOTE: In the dropdown box, you can select only one content type.

  • Hierarchical classifications
    For hierarchical classifications, such as Categories, you can choose between the following:
    • All categories
      All categories are displayed in the list.
    • Top level categories only
      All top level categories are displayed in the list.
    • All categories under particular category…
      All direct children of a specifically selected category are displayed in the list.
      To select a category, click Add (Select category) button.
    • Selected categories...
      A custom selection of categories is displayed. 
      To select one or more categories you want to display, click Add (Select categories) button.
    • Only categories used by content type...
      A custom selection of categories is displayed. Only categories assigned to the content type items selected are displayed in the list.

      NOTE: In the dropdown box, you can select only one content type.

List settings

In this section, you can configure the following chip selectors:

  • Show item count
    The count of all items to which the classification is assigned is displayed.
  • Display empty tags or categories
    Classifications that are not assigned to any item are displayed.

Display settings

In this section, choose how to display the selected classifications on the page..
Perform the following:

  1. In Template dropdown, you can select a template other than the default one that will be used to display the Classification widget on the website.

    You must first have created a custom template.
    For more information, see ASP.NET Core pages and templates.

  2. In Margins, you can choose the margins between the widget and the column where it is placed.
    Choose from the predefined values of none, small, medium, or large.

Save your changes.

Advanced widget settings

To open the advanced settings, in the upper-right corner of the Classification widget page, click DotNetCore11 (Advanced settings).

  1. Change the label
    In Label, you can enter a specific name for this widget.
    This name will be displayed in:
    • The page editor as a label for the widget
    • In the treeview with the page structure in the right pane of the page editor.
  2. Apply custom CSS
    In CSS class input field, you can choose a class name for the textbox, if later you want to set a CSS style for this particular textbox.
  3. Change the sorting
    By default, items are sorted in the list by publication date in descending order.

    You can also enter a custom sort expression.Use the following format: {fieldName} (ASC / DESC). For example, PublicationDate DESC

  4. Save your changes.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?

Next article

Image widget