Extend the Archive widget to use dynamic items

Use the following tutorial to extend the built-in Archive widget to display items created with the Module builder.

Perform the following:

  1. Open your project in Visual Studio.
  2. In the context menu of SitefinityWebApp, click Add » New Folder.
    Name the folder Controls
  3. In the context menu of the folder, click Add New Item... » Visual C# » Code » Class.
    Name the class CustomArchiveWidget.cs
  4. Open the created class and paste the following code:
  5. Build your solution.
  6. Register the new widget.
    For more information, see Register a new widget in Sitefinity CMS toolbox.
  7. Get the ContentType of your dynamic item.
    You do this in the following way:
    1. Navigate to Administration » Module Builder » <Your module>
    2. Open Code reference for <your module>.
    3. Click your content type and select one of the code snippets
    4. For example, Create <your content type>
    5. Copy the content type, as in the following screenshot:

      content type

  8. Create e new page or edit an existing one.
  9. Add the Custom Archive widget that you created on the page.
  10. Add the widget of your content type on the page.
  11. Edit the Custom Archive widget.
    In ContentType input field, enter the content type you copied in Step 7.
  12. Save your changes and publish the page.

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?