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.

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?