Category: Code Sample

C# Code Sample Configuration Modules Sitefinity

Check if a Sitefinity Module is Installed or Disabled

When working with the Sitefinity API and its various Content Managers, you need to make sure and consider the fact that after version 5.1, users have the ability to disable modules. Attempting to access the content manager of a disabled module will result in an exception such as this: [Exception: The configuration ‘EventsConfig’ is not […]

CONTINUE READING
Code Sample Customization Ecommerce Shopping Cart Sitefinity Templates Validation Widgets

Product Maximum and Minimums in Sitefinity Part 2: Shopping Cart

We previously looked at how you can enforce minimum and maximum product quantities on the Sitefinity product details page. However, users can still override the quantities in the shopping cart, defeating the restrictions. Fortunately, the shopping cart template also includes a validation control for each item. By mapping this control to an external User Control […]

CONTINUE READING
Code Sample Content Blocks Customization Pages Sitefinity Video Widgets

Creating a Hideable Sitefinity Content Block Widget

Adding a content block to a Sitefinity page with a Content widget (such as News, Events, Blogs, etc.) displays that content for both the master list and single item details view for the content. This video demonstrates how you can easily inherit from this control to make a hideable content block that only renders when […]

CONTINUE READING
API Code Sample Pages Permissions Sitefinity Widgets

Add Control to Sitefinity Page with Default Permissions

When adding controls to a Sitefinity page programmatically, by default it’s going to set restricted permissions so that only users in the Administrators role can view them. You can easily change this so that the widget is installed with the default permissions it would get by being dragged onto the page with the following code: […]

CONTINUE READING
API Code Sample Configuration Sitefinity Toolbox Widgets

Registering Toolbox Widgets During Sitefinity Module Installation

When developing a Sitefinity Intra-Site Module you’ll likely be creating public widgets that your users will be dropping onto pages. Rather than relying on your users to manually add them to the toolbox, you can register these controls yourself during module installation. Here is a demo code snippet that shows an example of how you […]

CONTINUE READING
Blogs Code Sample Sitefinity Taxonomy Widgets

Filtering the Sitefinity Taxonomy Widget for a Specific Blog

The classification widgets in Sitefinity allows you to display the list of taxonomy names (such as categories or tags) used by content items in Sitefinity. You can specify a specific content type (even Dynamic Modules with this workaround) and to allow your visitors to filter the content items. Custom Blogs Taxonomy Control However, if you […]

CONTINUE READING
Code Sample Pages Sitefinity Widgets

Programmatically Adding Controls to a Sitefinity Page

The PageManager in Sitefinity has a method called CreateControl that is overloaded to allow both Compiled (dll) controls as well as simple User Controls (.ascx files) to be initialized and added to a Sitefinity page. Both overloads require a string containing the name of the ContentPlaceholder that will hold the control, which is defined in […]

CONTINUE READING