Extend and customize the Content list widget

Customize the widget designer

You can cutomize both the List and the Details view of the Content list widget. 

For more information, see Create custom views for the Content list widget.

Extend the widget

GITHUB EXAMPLE: You can find examples on how to extend the Model, ViewModel, View, and the Entity classes as part of the Quantum demo sample in Sitefinity GitHub repository:

For more information, see Extend the built-in widgets.

Exclude content types

Extend ContentListEntity

In order to exclude content types form the content list widget, you need to inherit and extend the ContentListEntity class and add TypeBlacklist paramater to exlclude content types or add Type paramater to specify a list of allowed contet types.

For example:

using Progress.Sitefinity.AspNetCore;
using Progress.Sitefinity.AspNetCore.Widgets.Models.ContentList;
using Progress.Sitefinity.Renderer.Designers.Attributes;
using Progress.Sitefinity.Renderer.Entities.Content;
namespace SandboxWebApp.Entities
{
/// <summary>
/// Extended entity class for the ContentBlock view component.
/// </summary>
public class ExtendedContentListEntity : ContentListEntity
{
/// <inheritdoc />
[ContentSection(Constants.ContentSectionTitles.SelectContentToDisplay, 0)]
[Content(
Type = $"{KnownContentTypes.ListItems}, {KnownContentTypes.News}",
TypeBlacklist = "Telerik.Sitefinity.DynamicTypes.Model.PressReleases.Pressrelease"
)]
public override MixedContentContext SelectedItems
{
get
{
return base.SelectedItems;
}
set
{
base.SelectedItems = value;
}
}
}
}

Register the entity

Then you need to register the entity in the Program.cs file:

builder.Services.AddSingleton<ientityextender, entityextender<contentlistentity,="" sandboxwebapp.entities.extendedcontentlistentity="">>(); </ientityextender,>

Want to learn more?

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

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. 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?