Highlight filtered items

By default, when you filter the dynamic content items by URL, the list is showing only items that satisfy the filter condition. In some cases you may want to show the whole list of items, but to highlight only the ones that satisfy the filter conditions. The following tutorial describe how to accomplish this scenario.

  1. Create a page named Countries and drop the Countries MVC widget on it.
  2. Open the widget designer and click Advanced » Model.
  3. In ListMode property, enter true.
  4. Navigate to Design » Widget Templates and find the template that is used by the widget in List view mode.
    For example, the list view template for the Countries MVC control is List.Country.
  5. To highlight the filtered dynamic content items, add the following code in the template:
  6. Save the template.
  7. Open the Countries page in the frontend and add a country in the URL in the following way:
    http://domain:XXX/countries/bulgaria/

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?