/dw-extend:dw-extendfrom dw-extend
Guide for building best-practice extensions for Dynamicweb and Dynamicweb Swift — covers NotificationSubscribers, Providers, ScheduledTasks, Razor template overrides, CSS customization, and ViewModel extensions.
Ships in dw-extend. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are a Dynamicweb extension specialist. When the user asks you to build, scaffold, or advise on extending Dynamicweb or Dynamicweb Swift, follow this skill precisely.
Help the developer produce a clean, upgrade-safe, best-practice implementation. Always:
.cshtml) for frontend template overridesDetermine which extension type(s) are needed. A request may require more than one.
| What the developer wants | Extension type |
|---|---|
| React to a platform event (order placed, user login, page render, etc.) | NotificationSubscriber |
| Replace or override a core calculation (price, tax, shipping, stock, feed) | Provider |
| Run logic on a schedule or via the admin task runner | ScheduledTask AddIn |
| Change or add frontend presentation without touching Swift source | Swift CSS or Razor override |
| Add custom data to a Razor template context | ViewModel extension |
| Add custom UI, screens, or buttons in the Dynamicweb admin | Administration UI extension — use the dw-extend-admin-ui skill, not this one |
| Create custom database tables or migrate schema | UpdateProvider + Database query |
| Add search, product listing, or faceted filtering | Repository (index + query + facets) |
Extensions live in a separate C# class library that references Dynamicweb NuGet packages. Never put extension code inside the Dynamicweb core installation.
<!-- .csproj -->
<ItemGroup>
<PackageReference Include="Dynamicweb" Version="10.*" />
<!-- Add Dynamicweb.Ecommerce, Dynamicweb.Content etc. as needed -->
</ItemGroup>
Never build against a newer version than the solution runs — the add-in will fail to load, silently. Verified by A/B test on a live solution with identical source: built against
Dynamicweb10.28.9 (stable) the add-in loaded and its types appeared in the admin; rebuilt againstDynamicweb.Suite 10.29.2-PreReleasethe very same code stopped loading and its types vanished. In both casesdw installreportedok: true,status: 200, "App(s) successfully installed" and exit 0 — there is no error anywhere to tell you.
Version="10.*"resolves to the latest stable and excludes prereleases, which is why it is the safer default. Do not "helpfully" switch it to10.*-*or pin a prerelease unless the target solution really runs that build. After deploying, always confirm the add-in actually appears where it should — a successful install proves nothing about loading.
Use when you need to hook into a platform event and run code alongside (not instead of) the normal flow.
Base class: Dynamicweb.Extensibility.Notifications.NotificationSubscriber
Attribute: [Subscribe(NotificationName)]
Override: OnNotify(string notification, NotificationArgs args)
using Dynamicweb.Extensibility.Notifications;
[Subscribe(Dynamicweb.Ecommerce.Notifications.Ecommerce.Cart.CheckoutDoneOrderIsComplete)]
public class OrderPlacedSubscriber : NotificationSubscriber
{
public override void OnNotify(string notification, NotificationArgs args)
{
if (args is not Dynamicweb.Ecommerce.Notifications.Ecommerce.Cart.CheckoutDoneOrderIsCompleteArgs placedArgs)
return;
var order = placedArgs.Order;
// your logic here
}
}
Key rules:
[Subscribe] attributesargs to the specific args type for that notification before use; bail out safely if cast failsOnNotify unless the notification explicitly supports it — offload to a background service if neededFinding notification names:
Browse Dynamicweb.Ecommerce.Notifications, Dynamicweb.Content.Notifications, Dynamicweb.Security.Notifications etc. in the API reference at https://doc.dynamicweb.dev/api/
Use when you want to replace a core subsystem (price calculation, shipping, tax, stock levels, payment, etc.) with your own implementation. DynamicWeb will discover the provider and make it selectable in the admin.
Pattern: inherit the relevant base class, decorate with [AddInName] and [AddInLabel].
using Dynamicweb.Extensibility.AddIns;
using Dynamicweb.Ecommerce.Prices;
[AddInName("MyCompany.CustomPriceProvider")]
[AddInLabel("My Custom Price Provider")]
public class CustomPriceProvider : PriceProvider
{
public override PriceRaw FindPrice(PriceContext context, PriceProductSelection selection)
{
// return null to fall through to next provider
// return a PriceRaw to use this price
return null;
}
}
Common provider base classes:
| Use case | Base class | Key method |
|---|---|---|
| Custom price logic | Dynamicweb.Ecommerce.Prices.PriceProvider | FindPrice() |
| Custom shipping | Dynamicweb.Ecommerce.Orders.ShippingProvider | varies |
| Custom tax | Dynamicweb.Ecommerce.Prices.TaxProvider | varies |
| Custom stock | Dynamicweb.Ecommerce.Stocks.StockLevelProvider | varies |
| Custom cart calculation | Dynamicweb.Ecommerce.Prices.CartCalculationProvider | varies |
| Payment handler | Dynamicweb.Ecommerce.CheckoutHandlers.CheckoutHandler | varies |
| Custom product feed | Dynamicweb.Ecommerce.Feeds.FeedProvider | varies |
| Custom logging | Dynamicweb.Logging.ILoggerProvider (interface) | varies |
| Custom navigation | Dynamicweb.Content.Navigation.NavigationProvider | varies |
| Custom index | Dynamicweb.Indexing.IndexProviderBase | varies |
Key rules:
[AddInDescription("...")] for admin documentation[AddInConfigurable] properties (with AddInParameter attribute) to expose configuration in the adminUse when you need logic to run on a timer or to appear in the Dynamicweb Scheduled Tasks admin.
Base class: Dynamicweb.Scheduling.BaseScheduledTaskAddIn
Attributes: [AddInName], [AddInLabel], [AddInDescription] (these live in Dynamicweb.Extensibility.AddIns, the base class does not — you need both usings)
Method: override Run() — return true on success, false on failure
using System;
using Dynamicweb.Extensibility.AddIns; // attributes
using Dynamicweb.Extensibility.Editors; // IntegerNumberParameterEditor
using Dynamicweb.Scheduling; // BaseScheduledTaskAddIn
[AddInName("MyCompany.DataSyncTask")]
[AddInLabel("Data Sync Task")]
[AddInDescription("Syncs product data from the external ERP system.")]
public class DataSyncTask : BaseScheduledTaskAddIn
{
[AddInParameter("Batch size")]
[AddInParameterEditor(typeof(IntegerNumberParameterEditor), "")]
public int BatchSize { get; set; } = 100;
public override bool Run()
{
try
{
// your logic here
Dynamicweb.Logging.LogManager.System.GetLogger("MyCompany.DataSyncTask")
.Info($"DataSyncTask completed. BatchSize={BatchSize}");
return true;
}
catch (Exception ex)
{
Dynamicweb.Logging.LogManager.System.GetLogger("MyCompany.DataSyncTask")
.Error("DataSyncTask failed", ex);
return false;
}
}
}
Key rules:
Run() is called synchronously — wrap heavy work in try/catch and log exceptions[AddInParameter] + [AddInParameterEditor] propertiesfalse (not throw) to signal failure — this allows the scheduler to record it properlyGetLogger takes a string, not a Type. There is no Type overload, so GetLogger(typeof(MyTask)) does not compile (CS1503)When you need data that is not available on a ViewModel or in a NotificationArgs object, use the appropriate static Services class. Services are the correct way to read and write platform data from any extension type (NotificationSubscriber, Provider, ScheduledTask, etc.).
Pattern: call the static service accessor, then call methods on the returned service instance.
// Content — Dynamicweb.Content.Services
using Dynamicweb.Content;
var page = Services.Pages.GetPage(pageId); // int
var area = Services.Areas.GetArea(areaId); // int
var paragraphs = Services.Paragraphs.GetParagraphsByPageId(pageId); // int
var item = Services.Items.GetItem(itemType, itemId); // string, string
// Ecommerce — Dynamicweb.Ecommerce.Services
using Dynamicweb.Ecommerce;
var product = Services.Products.GetProductById(productId, variantId, languageId); // string x3
var order = Services.Orders.GetById(orderId); // string
var currency = Services.Currencies.GetCurrency(currencyCode); // string
var discount = Services.Discounts.GetDiscount(discountId); // int
var cartId = Services.Carts.GetActiveCartId(userId); // int -> cart id
// Users — Dynamicweb.Security.UserManagement.UserManagementServices
using Dynamicweb.Security.UserManagement;
var user = UserManagementServices.Users.GetUserById(userId); // int
var group = UserManagementServices.UserGroups.GetGroupById(groupId); // int
var addresses = UserManagementServices.UserAddresses.GetAddressesByUserId(userId);// int
// Forms — Dynamicweb.Forms.FormsServices
using Dynamicweb.Forms;
var form = FormsServices.Forms.GetById(formId); // int
var submits = FormsServices.Submits.GetSubmits(formId); // int
// Email marketing flows — NO static accessor; instantiate the service
using Dynamicweb.EmailMarketing.Flows;
var flow = new FlowService().GetFlow(flowId); // int
var recipients = new FlowRecipientService().GetRecipientsByFlowId(flowId); // int
Every call above is compile-verified against 10.29. Three traps worth knowing:
Services.Items cannot list items by type. ItemService exposes only GetItem(itemType, itemId),
GetItemById(id) and GetItemByPageId(pageId, ...). There is no "all items of type X" method — use a
repository/index query for that.Services.Carts is not a cart loader. It is Frontend.Cart.CartService and exposes only
GetActiveCartId(...). Load the cart itself with Services.Orders.GetById(cartId) — carts are orders.Services. accessor at all. Services.Flows and Services.FlowRecipients do not
exist; construct FlowService / FlowRecipientService directly.For a customer's orders use Services.Orders.GetCustomerOrdersByType(...), which takes a long parameter
list (int, string, OrderType, int, bool, string, DateTime, ...) — check the overloads rather than
guessing.
Available service entry points:
| Namespace | Entry point | Key services |
|---|---|---|
Dynamicweb.Content | Services.* | Pages, Areas, Paragraphs, Items, Grids, Colors, Comments |
Dynamicweb.Ecommerce | Services.* | Products, Orders, OrderLines, Carts, Prices, Discounts, Vouchers, Variants, Countries, Currencies, Shippings, Taxes, Payments, StockService, Manufacturers, Loyalty + 70 more |
Dynamicweb.Security.UserManagement | UserManagementServices.* | Users, UserGroups, UserAddresses, UserImpersonations, UserAndGroupTypes |
Dynamicweb.Forms | FormsServices.* | Forms, Fields, Options, Submits, SubmitData |
Dynamicweb.EmailMarketing | Services.* | Flows, FlowFolders, FlowSteps, FlowRecipients, FlowStepHistory |
Key rules:
newDatabase.ExecuteReader calls for data that services already expose — services apply business logic, permission checks, and caching that raw SQL bypassesAPI reference: https://doc.dynamicweb.dev/api/
Use when a Razor template needs data that is not in the standard ViewModel.
ProductViewModel exists in two namespaces — Dynamicweb.Ecommerce.ProductCatalog.ProductViewModel
(used below, carries StockLevel) and Dynamicweb.Ecommerce.Frontend.ProductViewModel. Import the wrong
one and the members will not resolve.
Option A — Extension method (for computed/derived values, no serialization needed):
using Dynamicweb.Ecommerce.ProductCatalog;
public static class ProductViewModelExtensions
{
public static string FormattedStockLabel(this ProductViewModel model)
=> model.StockLevel > 0 ? $"In stock ({model.StockLevel})" : "Out of stock";
}
Usage in template: @Model.FormattedStockLabel()
Option B — Subclass (for extra properties, JSON serialization, constructor injection):
using Dynamicweb.Ecommerce.ProductCatalog;
using Dynamicweb.Extensibility.AddIns;
[AddInName("MyProductViewModel")] // use ItemType SystemName if item-specific
public class MyProductViewModel : ProductViewModel
{
public string ExtraField => "computed value";
}
Key rule: You cannot override values that the base ViewModel sets during instantiation — create wrapper/new properties instead.
Use when your extension needs its own database tables or columns. The UpdateProvider runs automatically on application startup and applies any pending updates idempotently — safe to deploy multiple times.
Base class: Dynamicweb.Updates.UpdateProvider
Namespace: Dynamicweb.Updates
Override: GetUpdates() — return all schema changes this extension owns
using Dynamicweb.Updates;
public sealed class MyExtensionUpdateProvider : UpdateProvider
{
public override IEnumerable<Update> GetUpdates() => new List<Update>
{
// Create a custom table (only runs if table does not exist)
SqlUpdate.AddTable(
id: "A1B2C3D4-E5F6-7890-ABCD-EF1234567890",
provider: this,
tableName: "MyExtension_Product",
// The parentheses are REQUIRED - AddTable does not add them. See the warning below.
tableDefinition: """
(
MyExtension_ProductId INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
MyExtension_ProductExternalId NVARCHAR(255) NOT NULL,
MyExtension_ProductCreated DATETIME NOT NULL DEFAULT GETDATE()
)
"""
),
// Add a column (only runs if column does not exist)
SqlUpdate.AddColumn(
id: "B2C3D4E5-F6A7-8901-BCDE-F12345678901",
provider: this,
tableName: "MyExtension_Product",
columnName: "MyExtension_ProductSyncedAt",
columnDefinition: "DATETIME NULL"
),
// Change a column definition (only runs if column exists)
SqlUpdate.ChangeColumn(
id: "C3D4E5F6-A7B8-9012-CDEF-123456789012",
provider: this,
tableName: "MyExtension_Product",
columnName: "MyExtension_ProductExternalId",
columnDefinition: "NVARCHAR(500) NOT NULL"
),
// Add an index
SqlUpdate.AddIndex(
id: "D4E5F6A7-B8C9-0123-DEFA-234567890123",
provider: this,
tableName: "MyExtension_Product",
indexName: "IX_MyExtension_Product_ExternalId",
indexDefinition: "MyExtension_ProductExternalId ASC"
),
// Raw SQL update with an optional conditional (skip if condition returns rows)
new SqlUpdate(
id: "E5F6A7B8-C9D0-1234-EFAB-345678901234",
provider: this,
sql: "UPDATE MyExtension_Product SET MyExtension_ProductSyncedAt = GETDATE() WHERE MyExtension_ProductSyncedAt IS NULL",
sqlConditional: "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM MyExtension_Product WHERE MyExtension_ProductSyncedAt IS NULL)"
),
};
}
Key rules:
id must be a unique GUID across all UpdateProviders in the entire solution — generate a fresh one per update, never reuseAddTable, AddColumn, AddIndex all check existence before actingDropColumn is irreversible — use with care and only when the column is confirmed unusedOther update types:
| Type | Use case |
|---|---|
SqlUpdate | DDL and DML schema changes |
SettingUpdate | Insert or change settings in the Dynamicweb settings store |
MethodUpdate | Run arbitrary C# code as a one-time migration step |
FileUpdate | Copy or modify files during deployment |
AddTable requires you to supply the parentheses. This is the single most likely reason a new
table never appears. SqlUpdate.AddTable builds its SQL as:
IF NOT EXISTS (...) BEGIN CREATE TABLE {tableName} {tableDefinition} END
It interpolates tableDefinition raw, so a definition without ( ... ) produces
CREATE TABLE MyTable Col1 INT ... and fails with Incorrect syntax near 'Col1' (SQL error 102).
AddColumn behaves differently — it wraps the column name itself — so the two are not symmetric.
How updates are tracked. Each applied update becomes a row in Updates (UpdateId,
UpdateProviderName, UpdateTime), and UpdateManager skips any update already listed. Two
consequences:
Updates (or change the update's id).UpdateManager.ExecuteUpdatesCore catches each exception, logs it,
and moves on — so a broken update is invisible unless you read the log. It will also be retried on
every subsequent run, since nothing was recorded.When updates run. UpdateManager.ExecuteUpdates() is called from
Host.Core/Middleware/InitializersMiddleware on the first request after application start (once per app
lifetime, so once per recycle), and AddinProvider.LoadDlls calls ExecuteUpdates(providers) for an
add-in as it is loaded. A non-queued dw install therefore runs your updates at install time;
dw install -q cannot, because LocalAddinProvider.InstallDll only calls LoadIntoMemory when the
install is not queued.
If the table never appears, do not theorise — read the log. Update failures are recorded with the exact generated SQL. See Debugging on a live solution below for how to reach it, and check
Updatesfor your GUID to tell "never ran" from "already applied".
Use Dynamicweb.Data.Database (static class) for raw SQL access to both Dynamicweb core tables and your custom tables. Note the namespace is Dynamicweb.Data, not Dynamicweb.
using Dynamicweb.Data;
using System.Data;
// SELECT — returns an IDataReader. The method is CreateDataReader, not ExecuteReader.
using var reader = Database.CreateDataReader("SELECT MyExtension_ProductId, MyExtension_ProductExternalId FROM MyExtension_Product WHERE MyExtension_ProductSyncedAt IS NULL");
while (reader.Read())
{
var id = reader.GetInt32(0);
var externalId = reader.GetString(1);
}
// Scalar — single value
var count = Database.ExecuteScalar("SELECT COUNT(*) FROM MyExtension_Product");
// INSERT / UPDATE / DELETE — returns rows affected
Database.ExecuteNonQuery($"UPDATE MyExtension_Product SET MyExtension_ProductSyncedAt = GETDATE() WHERE MyExtension_ProductId = {id}");
Key rules:
using blocks around IDataReader to ensure the connection is releasedDatabase.ExecuteNonQuery returns the number of rows affected — check it when correctness mattersApplies to every extension type, not just updates. The recurring trap is that a successful deploy tells
you nothing about whether your code loaded or ran — dw install reports ok: true either way. Verify
against the feature, then read the log.
GeneralLog is a database table, not a file — it is what the admin's Event Viewer reads. Columns:
LogId, LogAction, LogDescription, LogUsername, LogDate, LogFilePath, LogLevel, UserId, UtcOffset, Exception, MachineName, Category, Url. Your own LogManager.System.GetLogger("Name") calls land here
too, which makes a log line the cheapest way to prove an extension executed.
Over the Management API, query it with LogEventByFilters. The class is LogEventByFiltersQuery but the
registered name drops the Query suffix, and it takes three filters — QueryAction, QueryCategory,
Level:
dw query LogEventByFilters --QueryAction Update --QueryCategory Application --Level Error --host <host> --apiKey "$KEY"
Tested: that narrows 96 rows to the 16 relevant ones. Row fields are camelCase and do not match the
table's column names — action, not logAction:
id, userName, userId, machineName, exceptionType, fileLogPath, action, category, description, createDate, level, url. Stack traces and generated SQL are in description.
EventViewerList is not a registered query name (400 "Unknown query").
Caution:
dw queryanddw commandleak--apiKeyinto the request URL (see the dw-setup-cli skill). For anything sensitive, call/Admin/Api/LogEventByFiltersyourself with anAuthorization: Bearerheader instead.
/Files/System/Log/AddInManager/TypeLoadErrors.log records every assembly the add-in manager could not
load, with the reason. A version mismatch looks like this — and note the (Context) suffix, because
add-ins are loaded into their own AssemblyLoadContext:
MyAddIn (Context) ReflectionTypeLoadException Could not load file or assembly
'Dynamicweb.Core, Version=10.29.2.0' ... The system cannot find the file specified.
The host's own path in that same file also tells you which version the solution actually runs, e.g.
D:\Dynamicweb.net\Applications\R0-net10\10.29.1\bin — useful, because the version is not exposed
anywhere in the API or the frontend.
| Type | How to check | Status |
|---|---|---|
| Any assembly | TypeLoadErrors.log, and the DLL under System/AddIns/Installed/<name>.<version>/ | verified |
ScheduledTaskAddIn | it appears in the solution's scheduled-task type list, with its [AddInParameter]s | verified |
UpdateProvider | a row in Updates for each update GUID; failures in GeneralLog | verified |
NotificationSubscriber | log a line from OnNotify and trigger the event, then look for it in GeneralLog | not verified here |
Provider (price, shipping, …) | it becomes selectable in the relevant admin screen | not verified here |
| ViewModel extension | render a template that calls it | not verified here |
The bottom three are the obvious approach rather than a tested recipe — treat them as such.
The Firehose is an admin-UI tool only. Its query is named DatabaseFirehose, but over the Management
API every call returns HTTP 500 — including SELECT 1 AS x — failing to serialize
Model.Exception.TargetSite.
To query the database over the API anyway, create a scheduled task of type
Dynamicweb.Scheduling.ScheduledTaskAddIns.RunSqlScheduledTaskAddIn, Dynamicweb.Core and run it.
Triggering a task only returns pass/fail, so surface actual values by forcing them into the error text:
DECLARE @m NVARCHAR(1900);
SELECT @m = ISNULL(STRING_AGG(CAST(name AS NVARCHAR(200)), ','), '(none)') FROM sys.tables WHERE name LIKE 'Pdex%';
RAISERROR(@m, 16, 1);
The message then appears in that task's log under System/Log/ScheduledTasks/. Set the add-in's
Log debugging info parameter to True so the executed SQL is logged as well.
Note
dw files -ecannot export a file whose name contains a space (the CLI keeps the quotes from theContent-Dispositionheader), and scheduled-task logs are named after the task. Fetch those through theFileDownloadAPI endpoint instead.
A previous author of this skill concluded in turn that an UpdateProvider "never runs", then that add-in
load contexts were isolating it, then that it was a platform bug — through several application recycles
and a source-code investigation. The actual cause was a one-line SQL syntax error, recorded in
GeneralLog from the first attempt. Read the log before forming a theory.
Understanding where files live is essential before touching anything.
Files/
├── GlobalSettings.config # Main DW config (DB connection, site settings)
├── GlobalSettings.Ecom.config # Ecommerce-specific global settings
├── Images/
│ └── Icons/
│ ├── *.svg # UI icon set used across Swift
│ ├── Flags/ # Country/language flag SVGs
│ └── LoginProviders/ # Social/external login icons
├── System/
│ ├── Items/ # Item type XML field schema definitions
│ ├── Repositories/ # Search index configurations
│ │ ├── Content/ # Page/content index
│ │ ├── Files/ # File asset index
│ │ ├── Post/ # Blog/post index
│ │ ├── ProductsBackend/ # Product index for admin
│ │ ├── ProductsFrontend/ # Product index for frontend
│ │ └── Secondary users/ # Secondary user account index
│ └── Styles/
│ └── ColorSchemes/ # Color scheme definitions → generates --dw-color-* CSS variables
└── Templates/
├── CookieWarning/ # Cookie consent banner template
├── Items/ # Item type editor templates (admin UI)
└── Designs/
└── Swift-v2/ # ← entire Swift v2 design lives here
├── Assets/
│ ├── css/ # Swift.css + custom.css (your overrides go here)
│ ├── js/ # Swift JavaScript
│ ├── images/ # Email assets, file type icons, item type previews
│ └── lib/ # Bundled JS libraries:
│ ├── alpinejs/ # Alpine.js (reactivity)
│ ├── bootstrap/ # Bootstrap (grid + components)
│ ├── flatpickr/ # Date picker
│ ├── htmx.org/ # htmx (AJAX)
│ └── swiffy-slider/ # Carousel/slider
├── Components/ # Shared Razor partials reused across item types
├── Custom/ # ← YOUR customization layer (project-specific files)
├── Forms/ # Dynamicweb Forms rendering templates
├── Grid/
│ ├── Page/ # Page layout — row definitions + row templates
│ └── Email/ # Email layout — row definitions + row templates
├── Navigation/ # Vertical nav + breadcrumb templates
├── Paragraph/ # One folder per Swift item type (content building blocks):
│ ├── Swift-v2_Accordion/
│ ├── Swift-v2_Button/
│ ├── Swift-v2_Card/
│ ├── Swift-v2_Image/
│ ├── Swift-v2_Navigation/
│ ├── Swift-v2_Poster/
│ ├── Swift-v2_Slider/
│ ├── Swift-v2_Text/
│ ├── Swift-v2_TextAndImage/
│ └── ... (30+ item types total)
├── QueryPublisher/ # Post/blog list query templates
├── Swift-v2_Email/ # Transactional + marketing email templates
├── UserManagement/ # Login, create profile, view profile pages
├── Users/ # Full user self-service:
│ ├── UserAddresses/ # Address list + edit
│ ├── UserAuthentication/# Login flow
│ ├── UserChangePassword/# Password change
│ ├── UserCreate/ # Registration + confirmation email
│ ├── UserEdit/ # Profile editing
│ ├── UserForgotPassword/# Forgot/reset password flow
│ ├── UserGroups/ # User group management
│ └── UserView/ # User list + detail views
├── eCom/ # Ecommerce templates:
│ ├── CustomerCenter/ # B2B customer center
│ ├── CustomerExperienceCenter/ # Orders, favorites, saved cards
│ ├── IntegrationCustomerCenter/
│ └── ProductCatalog/ # Product list + slider
└── eCom7/
├── CartV2/ # Checkout flow (cart steps + order confirmation emails)
└── ShippingProvider/ # Shipping method selection template
Complete item type reference (by category):
| SystemName | Display name | Notes |
|---|---|---|
| Swift-v2 (page level) | ||
Swift-v2_Master | Master | Master layout page |
Swift-v2_Page | Page | Standard content page |
Swift-v2_PageProperties | Page properties | SEO/meta settings for a page |
Swift-v2_ServicePage | Service page | Technical/utility page |
| Swift-v2/Layout | ||
Swift-v2_Header | Header | Site header layout |
Swift-v2_Footer | Footer | Site footer layout |
| Swift-v2/Grid | ||
Swift-v2_Row | Row with columns | Fixed column grid row |
Swift-v2_RowFlex | Row with flexible columns | Flexible column grid row |
| Swift-v2/Paragraphs/Standard | ||
Swift-v2_Accordion | Accordion | Collapsible FAQ-style sections |
Swift-v2_Accordion_Item | Accordion Item | Child item for Accordion |
Swift-v2_App | App | Wrapper for Dynamicweb apps |
Swift-v2_Blockquote | Blockquote | Styled quote block |
Swift-v2_Button | Button | CTA button |
Swift-v2_Card | Card | Image + text card |
Swift-v2_CookieNotice | Cookie notice | Cookie consent banner |
Swift-v2_Employee | Employee | Employee profile card |
Swift-v2_Feature | Feature | Icon + text feature highlight |
Swift-v2_HelloUser | Hello user | Personalised greeting |
Swift-v2_Image | Image | Standalone image block |
Swift-v2_ImpersonationBar | Impersonation bar | B2B user impersonation indicator |
Swift-v2_Information_Item | Information Item | Child list item |
Swift-v2_LocationsMap | Locations map | Multi-location map |
Swift-v2_Logo | Logo | Site logo |
Swift-v2_PostList | Post list | Blog/news post list |
Swift-v2_Poster | Poster | Full-width hero/poster block |
Swift-v2_ProductComponentSlider | Product component slider | Slider of product components |
Swift-v2_ProductGroupGrid | Products group grid | Ecom product group grid |
Swift-v2_ProductGroupSlider | Products group slider | Ecom product group slider |
Swift-v2_SearchField | Search field | Site search input |
Swift-v2_SimpleMap | Simple map | Single-location map (no API key needed) |
Swift-v2_Slider | Slider | Swiffy Slider carousel |
Swift-v2_Slider_Item | Slider Item | Child item for Slider |
Swift-v2_Text | Text | Rich text block |
Swift-v2_TextAndImage | Text and image | Side-by-side text + image |
Swift-v2_VideoPlayer | Video player | Embedded video, no layout options |
Swift-v2_VideoPoster | Video poster | Video with poster image |
| Swift-v2/Paragraphs/Navigation | ||
Swift-v2_BreadcrumbNavigation | Breadcrumb navigation | Page breadcrumb trail |
Swift-v2_Favorites | Favorites | Saved favorites list |
Swift-v2_MenuProductGroupImages | Menu: Ecom with Product Group Images | Mega menu with group images (2 levels) |
Swift-v2_MenuRelatedContent | Menu: Ecom with Related Content | Mega menu with related content (3 levels) |
Swift-v2_MiniCart | Mini cart | Cart icon + item count |
Swift-v2_MyAccount | My account | User account dropdown/link |
Swift-v2_Navigation | Navigation | Main site navigation |
Swift-v2_OffCanvasNavigation | Off-Canvas navigation | Mobile slide-out navigation |
Swift-v2_Preferences | Preferences | Language/currency switcher |
Swift-v2_SignIn | Sign in | Login link/button |
| Swift-v2/Paragraphs/ProductDetails | ||
Swift-v2_ProductMedia | Media | Product images with thumbnails |
Swift-v2_ProductMediaGallery | Media gallery | Full product image gallery |
Swift-v2_ProductMediaTable | Media table | Product media in table layout |
Swift-v2_ProductFieldDisplayGroupsAccordion | Product field display groups accordion | Product specs as accordion |
Swift-v2_RelatedProductsList | Related products list view | Related/cross-sell product list |
| Swift-v2/Paragraphs/ProductList | ||
Swift-v2_ProductListFacets | Facets | Filter facets panel |
Swift-v2_ProductListSelectedFacets | Facets (selected) | Active filter chips |
Swift-v2_ProductListInfo | Group description (info) | Ecom group title + description |
Swift-v2_ProductListHeader | Group header | Group name + product count |
Swift-v2_ProductListGroupImage | Group image | Ecom group image |
Swift-v2_ProductGroupList | Group navigation | Product group links |
Swift-v2_ProductListGroupPoster | Group poster | Large group image poster |
Swift-v2_ProductListNavigation | Navigation | Pagination / list navigation |
Swift-v2_ProductListItemRepeater | Product component repeater | Custom list view — repeats a component |
Swift-v2_ProductListSortBy | Sort by | Sort order selector |
| Swift-v2/Paragraphs/ProductPartial | ||
Swift-v2_ProductAddToCart | Add to cart | Add to cart button |
Swift-v2_ProductAddToDownloadCart | Add to download cart | Add to download cart |
Swift-v2_ProductAddToFavorites | Add to favorites | Wishlist/favorites button |
Swift-v2_ProductAddToQuoteCart | Add to quote cart | Quote cart button |
Swift-v2_BackInStockNotification | Back in stock notification | Out-of-stock alert sign-up |
Swift-v2_ProductBom | BOM | Bill of materials |
Swift-v2_ProductDefaultImage | Default product image | Fallback product image |
Swift-v2_ProductDownloadData | Download data form | Downloadable data form |
Swift-v2_ProductDownloadPublication | Download publication | Downloadable publication |
Swift-v2_ProductFieldDisplayGroups | Product field display groups | Product specs as list |
Swift-v2_ProductHeader | Name | Product name/title |
Swift-v2_ProductLongDescription | Description (long) | Full product description (detail page only) |
Swift-v2_ProductShortDescription | Description (short) | Product teaser text |
Swift-v2_ProductNumber | Number | Product number/SKU |
Swift-v2_ProductPrice | Price | Default product price |
Swift-v2_ProductPriceTable | Price table | Quantity price matrix |
Swift-v2_ProductQuantity | Quantity | Static quantity (for BOM items) |
Swift-v2_ProductStaticVariants | Static variant view | Non-interactive variant display |
Swift-v2_ProductStock | Stock | Stock level indicator |
Swift-v2_ProductStockLocations | Stock locations | Per-location stock levels |
Swift-v2_ProductVariantSelector | Selectable variant options | Variant selector (blocks add-to-cart until complete; detail page only) |
Swift-v2_VariantGroups | Variant Groups | Variant group display |
| Swift-v2/Ecom | ||
Swift-v2_Shop | Shop | Product list page with Product Catalog App |
Swift-v2_ProductList | Product list | Product listing configuration |
Swift-v2_ProductDetails | Product details | Product detail page configuration |
Swift-v2_CartSummary | Cart Summary | Cart totals summary |
Swift-v2_ProductComponent | Product component | Reusable component for detail + list cards |
Swift-v2_ProductComponentSelector | Product component selector | Selects which component to render |
Swift-v2_ProductListComponent | Product list component | Reusable component for list items |
Swift-v2_ProductListComponentSelector | Product list component selector | Selects which list component to render |
| Swift-v2/Utilities | ||
Swift-v2_Cart | Cart | Shopping cart page |
Swift-v2_CartApp | Cart App | Cart as a Dynamicweb app |
Swift-v2_Checkout | Checkout | Checkout page |
Swift-v2_CheckoutApp | Checkout App | Checkout as a Dynamicweb app |
Swift-v2_DownloadCartApp | Download cart App | Download cart app setup |
Swift-v2_ExpressBuy | Express Buy | Quick-buy flow |
Swift-v2_ExpressBuyApp | Express Buy App | Express buy as a Dynamicweb app |
Swift-v2_QuoteCheckoutApp | Quote checkout App | Quote checkout as a Dynamicweb app |
Swift-v2_SearchPage | Search page | Site search results page |
Swift-v2_DisabledDeliveryDate_Item | Disabled Delivery Date Item | Blackout date for delivery calendar |
| Swift-v2/Emails | ||
Swift-v2_Email | Email layout root | |
Swift-v2_EmailHeader | Email header | Email header block |
Swift-v2_EmailFooter | Email footer | Email footer block |
Swift-v2_EmailRow | Email Row | Email grid row |
Swift-v2_EmailArticle | Article | Text + image + button block |
Swift-v2_EmailButton | Button | Email CTA button |
Swift-v2_EmailHeading | Heading | Email heading text |
Swift-v2_EmailIcons | Icons | Icon row in email |
Swift-v2_EmailIcon_Item | Icon item | Child item for Icons |
Swift-v2_EmailImage | Image | Email image block |
Swift-v2_EmailMenu | Menu | Email navigation menu |
Swift-v2_EmailMenu_Item | Menu item | Child item for Menu |
Swift-v2_EmailOrderlines | Orderlines | Order line items block |
Swift-v2_EmailProductCatalog | Product catalog | Product list in email |
Swift-v2_EmailBackInStockNotificationProductCatalog | Back in stock notification product catalog | Back-in-stock product block |
Swift-v2_EmailSpacer | Spacer | Vertical spacing block |
Swift-v2_EmailText | Text | Email text block |
Swift-v2_EmailUnsubscribeLink | Unsubscribe link | Unsubscribe footer link |
Swift-v2_EmailViewInBrowser | View in browser | View-in-browser link |
| Swift-v2/Misc | ||
Swift-v2_ServicesFolder | Service folder | Container for service pages |
Customization entry points — in order of preference:
| What you want to change | Where to put it |
|---|---|
| CSS variable overrides, brand colors, spacing | Assets/css/custom.css |
| Override an existing Razor template | Mirror the path in your own Design folder (not Swift-v2 directly) |
| Add a new item type | Paragraph/YourItemType/ + register in System/Items/ |
| Project-specific partials and helpers | Custom/ |
| Color scheme (generates CSS variables) | System/Styles/ColorSchemes/ |
# Add Swift as upstream so you can pull future updates
git remote add upstream https://github.com/dynamicweb/Swift.git
git fetch upstream
# Create a feature branch for your customization
git checkout -b feature/my-customization
# To pull Swift updates later
git fetch upstream
git merge upstream/main --allow-unrelated-histories
custom.css)Load order: Swift.css → Dynamicweb-generated color/typography files → your custom.css (wins)
File location: place your overrides in custom.css at the root of your Swift customization project. It is loaded last and takes precedence.
/* Use CSS custom properties (variables) — never hard-code values */
:root {
--dw-font-family: "My Brand Font", sans-serif;
--dw-btn-border-radius: 0.25rem;
}
/* Scope overrides with Swift's semantic attributes for precision */
[data-dw-colorscheme="light"] [data-dw-itemtype="swift-v2_text"] {
background-color: var(--dw-color-button-primary);
}
/* Target layout sections and columns */
[data-swift-gridrow] { gap: 2rem; }
[data-swift-gridcolumn] { padding: 1rem; }
Use only variables Swift actually defines. An unknown custom property is not an error — it silently has no effect, so a typo here fails quietly rather than loudly. Verified against Swift v2.4, the families are:
| Family | Variables |
|---|---|
| Colour | --dw-color-background, --dw-color-foreground, --dw-color-button-primary, --dw-color-button-secondary, each also as -rgb, and -contrast on the button colours |
| Font | --dw-font-family, --dw-font-size, --dw-font-style, --dw-font-weight, --dw-base-font-size |
| Button | --dw-btn-border-radius, --dw-btn-border-width, --dw-btn-padding-x, --dw-btn-padding-y |
| Layout | --dw-container-width, --dw-container-gutter |
There is no accent colour and no --dw-font-body. Confirm against the solution's own
Assets/css/swift.css before inventing a name — it is served at
/Files/Templates/Designs/Swift-v2/Assets/css/swift.css.
Available CSS variable groups:
| Prefix | Controls |
|---|---|
--dw-font-* | Font family, weight, line-height, spacing |
--dw-btn-* | Button padding, radius, border width |
--dw-color-* | Color scheme colors (auto-generated from backend) |
Key rules:
--dw-color-* variables instead of hex values so color scheme changes propagateSwift.css or the Dynamicweb-generated CSS filesOverride a Swift Razor template by placing a file at the same relative path in your customization project. Swift resolves templates with your version taking priority.
/Files/Templates/Designs/Swift-v2/ ← Swift source (do not edit)
/Files/Templates/Designs/MyCustom/ ← your overrides (same relative paths)
Impact levels:
Best practice: override as little as possible. If you only need a small change inside a template, consider using a CSS selector or a JavaScript hook before reaching for a full Razor override.
When the built-in Swift item types don't cover a requirement, create a custom ItemType. Each ItemType consists of:
Files/System/Items/ — defines fields, admin UI layout, and activation rulesFiles/Templates/Designs/Swift-v2/Paragraph/YourItemType/ — renders the block on the frontend<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<items>
<item
category="Swift-v2/Paragraphs/Standard"
name="My Block"
systemName="MyPrefix_MyBlock"
description=""
icon="Columns"
iconColor="None"
image=""
includeInUrlIndex="False"
pageDefaultView=""
paragraphDefaultModule=""
fieldForTitle="Title"
title=""
inherits="">
<fields>
<!-- field definitions -->
</fields>
<rules>
<!-- activation and restriction rules -->
</rules>
<layout>
<groups>
<!-- admin UI field groupings -->
</groups>
</layout>
</item>
</items>
Key <item> attributes:
systemName — MyPrefix_BlockName; prefix with your project/company to avoid collisions with Swift corecategory — Swift-v2/Paragraphs/Standard for general blocks, or any custom path you definefieldForTitle — systemName of the field shown as the block's display name in the admin treeicon — Bootstrap Icons name (e.g. AlignLeft, AspectRatio, Book, Columns, Image) — see https://icons.getbootstrap.com/<field
name="Display Name"
systemName="CamelCase"
description=""
type="System.String, System.Private.CoreLib"
excludeFromSearch="False"
defaultValueCulture="en-DK"
defaultValue="Optional default value">
<editor type="Dynamicweb.Content.Items.Editors.EditorName, Dynamicweb">
<editorConfuguration>
<Parameters addin="Dynamicweb.Content.Items.Editors.EditorName">
<Parameter addin="Dynamicweb.Content.Items.Editors.EditorName" name="ParamName" value="ParamValue" />
</Parameters>
</editorConfuguration>
</editor>
</field>
Note:
editorConfugurationis the correct (intentional typo) spelling used by Dynamicweb — do not correct it.
Field type values by data type:
| Data type | type attribute |
|---|---|
| Text (most fields) | System.String, System.Private.CoreLib |
| Boolean (checkbox) | System.Boolean, System.Private.CoreLib |
| Integer | System.Int32, System.Private.CoreLib |
| DateTime | System.DateTime, System.Private.CoreLib |
All editors live in Dynamicweb.Content.Items.Editors.*. The full editor type is Dynamicweb.Content.Items.Editors.EditorName, Dynamicweb.
| Editor | Field type | Key <Parameter> names | Purpose |
|---|---|---|---|
RichTextEditor | String | DefaultFontStyle, ShowToggle, ShowTagSelector, ShowStyleSelector | Multi-line rich text with full toolbar |
RichTextEditorLight | String | DefaultFontStyle, DefaultTag, ShowToggle, ShowTagSelector, ShowStyleSelector | Single-line heading/subtitle with limited toolbar |
TextEditor | String | ShowToggle | Plain single-line text |
LongTextEditor | String | ShowToggle | Plain multi-line textarea |
ButtonEditor | String | ShowToggle, EnablePageSelection, EnableParagraphSelection, EnableFileSelection, EnableProductSelection, EnableProductGroupSelection, DefaultLabel, DefaultDesign | Link + label + style (button component) |
LinkEditor | String | EnablePageSelection, EnableParagraphSelection, SelectOnlyID, EnableFileSelection, EnableProductSelection, EnableProductGroupSelection | Plain URL link (no button styling) |
FileEditor | String | Show as image selector, Use focal point selector for images, Use aspect ratio for images, Default aspect ratio, Allow file upload from frontend, Max files to add | Image or file picker |
MediaEditor | String | — | Video/media file picker |
CheckboxEditor | Boolean | (none) | Single on/off toggle |
CheckboxListEditor | String | ShowToggle | Multiple checkboxes from a Static options list |
DropDownListEditor | String | ShowToggle | Single-select dropdown from a Static options list |
RadioButtonListEditor | String | ItemTemplate, ShowToggle | Radio buttons from a Static options list |
BoxedRadioEditor | String | (none) | Visual boxed radio buttons (S/M/L/XL size picker style) — requires generic type suffix in type attribute |
VisualSelectListEditor | String | — | Icon-based visual option selector |
IntegerEditor | String | Min, Max | Whole number input |
InputHTML5Editor | String | InputType, Placeholder, Min, Max, Step | HTML5 input types (number, range, email, etc.) |
DateEditor | DateTime | ShowToggle | Date/time picker |
ItemRelationListEditor | String | ItemType (systemName of the child item type) | Ordered list of child items of a specific ItemType |
GeolocationEditor | String | — | Lat/lng map picker |
SingleUserEditor | String | (none) | Single user picker |
SingleUserGroupEditor | String | (none) | Single user group picker |
ProductCatalogEditor | String | — | Product catalog picker |
ProductCatalogGroupEditor | String | — | Product catalog group picker |
Rich text heading (RichTextEditorLight):
<field name="Title" systemName="Title" description="" type="System.String, System.Private.CoreLib" excludeFromSearch="False" defaultValueCulture="en-DK" defaultValue="My title">
<editor type="Dynamicweb.Content.Items.Editors.RichTextEditorLight, Dynamicweb">
<editorConfuguration><Parameters addin="Dynamicweb.Content.Items.Editors.RichTextEditorLight"><Parameter addin="Dynamicweb.Content.Items.Editors.RichTextEditorLight" name="DefaultFontStyle" value="dw-h2" /><Parameter addin="Dynamicweb.Content.Items.Editors.RichTextEditorLight" name="DefaultTag" value="h2" /><Parameter addin="Dynamicweb.Content.Items.Editors.RichTextEditorLight" name="ShowToggle" value="True" /><Parameter addin="Dynamicweb.Content.Items.Editors.RichTextEditorLight" name="ShowTagSelector" value="True" /><Parameter addin="Dynamicweb.Content.Items.Editors.RichTextEditorLight" name="ShowStyleSelector" value="True" /></Parameters></editorConfuguration>
</editor>
</field>
Rich text body (RichTextEditor):
<field name="Text" systemName="Text" description="" type="System.String, System.Private.CoreLib" excludeFromSearch="False" defaultValueCulture="en-DK" defaultValue="">
<editor type="Dynamicweb.Content.Items.Editors.RichTextEditor, Dynamicweb">
<editorConfuguration><Parameters addin="Dynamicweb.Content.Items.Editors.RichTextEditor"><Parameter addin="Dynamicweb.Content.Items.Editors.RichTextEditor" name="DefaultFontStyle" value="dw-paragraph" /><Parameter addin="Dynamicweb.Content.Items.Editors.RichTextEditor" name="ShowToggle" value="True" /><Parameter addin="Dynamicweb.Content.Items.Editors.RichTextEditor" name="ShowTagSelector" value="True" /><Parameter addin="Dynamicweb.Content.Items.Editors.RichTextEditor" name="ShowStyleSelector" value="True" /></Parameters></editorConfuguration>
</editor>
</field>
Plain text (TextEditor):
<field name="Alt text" systemName="AltText" description="" type="System.String, System.Private.CoreLib" excludeFromSearch="False" defaultValueCulture="en-DK" defaultValue="">
<editor type="Dynamicweb.Content.Items.Editors.TextEditor, Dynamicweb">
<editorConfuguration><Parameters addin="Dynamicweb.Content.Items.Editors.TextEditor"><Parameter addin="Dynamicweb.Content.Items.Editors.TextEditor" name="ShowToggle" value="True" /></Parameters></editorConfuguration>
</editor>
</field>
Image with focal point (FileEditor):
<field name="Image" systemName="Image" description="" type="System.String, System.Private.CoreLib" excludeFromSearch="False">
<editor type="Dynamicweb.Content.Items.Editors.FileEditor, Dynamicweb">
<editorConfuguration><Parameters addin="Dynamicweb.Content.Items.Editors.FileEditor"><Parameter addin="Dynamicweb.Content.Items.Editors.FileEditor" name="Base directory" value="" /><Parameter addin="Dynamicweb.Content.Items.Editors.FileEditor" name="Extensions" value="" /><Parameter addin="Dynamicweb.Content.Items.Editors.FileEditor" name="Show as image selector" value="True" /><Parameter addin="Dynamicweb.Content.Items.Editors.FileEditor" name="Use focal point selector for images" value="True" /><Parameter addin="Dynamicweb.Content.Items.Editors.FileEditor" name="Allow file upload from frontend" value="False" /><Parameter addin="Dynamicweb.Content.Items.Editors.FileEditor" name="Max files to add" value="" /></Parameters></editorConfuguration>
</editor>
</field>
Button with full link options (ButtonEditor):
<field name="First button" systemName="FirstButton" description="" type="System.String, System.Private.CoreLib" excludeFromSearch="False" defaultValueCulture="en-DK" defaultValue="Click here">
<editor type="Dynamicweb.Content.Items.Editors.ButtonEditor, Dynamicweb">
<editorConfuguration><Parameters addin="Dynamicweb.Content.Items.Editors.ButtonEditor"><Parameter addin="Dynamicweb.Content.Items.Editors.ButtonEditor" name="ShowToggle" value="True" /><Parameter addin="Dynamicweb.Content.Items.Editors.ButtonEditor" name="EnablePageSelection" value="True" /><Parameter addin="Dynamicweb.Content.Items.Editors.ButtonEditor" name="EnableParagraphSelection" value="True" /><Parameter addin="Dynamicweb.Content.Items.Editors.ButtonEditor" name="EnableFileSelection" value="True" /><Parameter addin="Dynamicweb.Content.Items.Editors.ButtonEditor" name="EnableProductSelection" value="True" /><Parameter addin="Dynamicweb.Content.Items.Editors.ButtonEditor" name="EnableProductGroupSelection" value="True" /><Parameter addin="Dynamicweb.Content.Items.Editors.ButtonEditor" name="DefaultLabel" value="Click here" /><Parameter addin="Dynamicweb.Content.Items.Editors.ButtonEditor" name="DefaultDesign" value="primary" /></Parameters></editorConfuguration>
</editor>
</field>
Checkbox (CheckboxEditor):
<field name="Show title" systemName="ShowTitle" description="" type="System.Boolean, System.Private.CoreLib" excludeFromSearch="False" defaultValueCulture="en-DK" defaultValue="True">
<editor type="Dynamicweb.Content.Items.Editors.CheckboxEditor, Dynamicweb">
<editorConfuguration><Parameters addin="Dynamicweb.Content.Items.Editors.CheckboxEditor" /></editorConfuguration>
</editor>
</field>
Dropdown with static options (DropDownListEditor):
<field name="Size" systemName="Size" description="" type="System.String, System.Private.CoreLib" excludeFromSearch="False" defaultValueCulture="en-DK" defaultValue="medium">
<editor type="Dynamicweb.Content.Items.Editors.DropDownListEditor, Dynamicweb">
<editorConfuguration><Parameters addin="Dynamicweb.Content.Items.Editors.DropDownListEditor"><Parameter addin="Dynamicweb.Content.Items.Editors.DropDownListEditor" name="ShowToggle" value="True" /></Parameters></editorConfuguration>
</editor>
<options sourceType="Static">
<Static>
<option name="Small" value="small" icon="" />
<option name="Medium" value="medium" icon="" />
<option name="Large" value="large" icon="" />
</Static>
</options>
</field>
Boxed radio S/M/L/XL size picker (BoxedRadioEditor):
<field name="Height" systemName="Height" description="" type="System.String, System.Private.CoreLib" excludeFromSearch="False" defaultValueCulture="en-DK" defaultValue="2">
<editor type="Dynamicweb.Content.Items.Editors.BoxedRadioEditor`1, Dynamicweb">
<editorConfuguration><Parameters addin="Dynamicweb.Content.Items.Editors.BoxedRadioEditor`1[[System.String, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]" /></editorConfuguration>
</editor>
<options sourceType="Static">
<Static>
<option name="S" value="1" icon="" />
<option name="M" value="2" icon="" />
<option name="L" value="3" icon="" />
<option name="XL" value="4" icon="" />
</Static>
</options>
</field>
Date picker (DateEditor):
<field name="Publish date" systemName="PublishDate" description="" type="System.DateTime, System.Private.CoreLib" excludeFromSearch="False">
<editor type="Dynamicweb.Content.Items.Editors.DateEditor, Dynamicweb">
<editorConfuguration><Parameters addin="Dynamicweb.Content.Items.Editors.DateEditor"><Parameter addin="Dynamicweb.Content.Items.Editors.DateEditor" name="ShowToggle" value="True" /></Parameters></editorConfuguration>
</editor>
</field>
Child item list (ItemRelationListEditor):
<field name="Items" systemName="Items" description="" type="System.String, System.Private.CoreLib" excludeFromSearch="False">
<editor type="Dynamicweb.Content.Items.Editors.ItemRelationListEditor, Dynamicweb">
<editorConfuguration><Parameters addin="Dynamicweb.Content.Items.Editors.ItemRelationListEditor"><Parameter addin="Dynamicweb.Content.Items.Editors.ItemRelationListEditor" name="ItemType" value="MyPrefix_MyBlock_Item" /></Parameters></editorConfuguration>
</editor>
</field>
Required validator (add inside <field> after </editor>):
<validators>
<validator type="Dynamicweb.Content.Items.Validators.RequiredValidator, Dynamicweb" />
</validators>
<rules>
<!-- Which websites can use this item type (* = all) -->
<rule name="Allow in websites" type="Dynamicweb.Content.Items.Activation.AreaRestrictionRule, Dynamicweb" value="*" />
<!-- Which parent item types can contain this block (comma-separated systemNames) -->
<rule name="Allowed parents" type="Dynamicweb.Content.Items.Activation.ParentItemTypeRestrictionRule, Dynamicweb" value="Swift-v2_Page,Swift-v2_Row" />
<!-- Which item types can be children of this block (empty = no restriction) -->
<rule name="" type="Dynamicweb.Content.Items.Activation.ChildItemTypeRestrictionRule, Dynamicweb" value="" />
<!-- Leave these three at their defaults -->
<rule name="Allowed children" type="Dynamicweb.Content.Items.Activation.ChildRestrictionRule, Dynamicweb" value="System.Collections.Generic.HashSet`1[System.String]" />
<rule name="Allowed parent types" type="Dynamicweb.Content.Items.Activation.ParentRestrictionRule, Dynamicweb" value="" />
<rule name="Allow in tree sections" type="Dynamicweb.Content.Items.Activation.SectionRestrictionRule, Dynamicweb" value="" />
<!-- Whether the block inherits the page color scheme (true = yes) -->
<rule name="" type="Dynamicweb.Content.Items.Activation.ColorSchemeRestrictionRule, Dynamicweb" value="true" />
<!-- Paragraphs = content block (most common); Pages = page-level item -->
<rule name="Enable item type for" type="Dynamicweb.Content.Items.Activation.StructureRestrictionRule, Dynamicweb" value="Paragraphs" />
</rules>
Common Allowed parents values:
| Use case | Value |
|---|---|
| General content block | Swift-v2_Page,Swift-v2_Row |
| Usable everywhere (header, footer, product pages) | Swift-v2_Footer,Swift-v2_Header,Swift-v2_Page,Swift-v2_ProductComponent,Swift-v2_ProductDetails,Swift-v2_ProductList,Swift-v2_ProductListComponent,Swift-v2_Row |
| Child item (only inside a specific parent) | MyPrefix_MyBlock (the parent's systemName) |
<layout>
<groups>
<group name="Content" systemName="Content" sectionName="" collapsibleState="None" visibilityField="" visibilityCondition="" visibilityConditionValueType="" visibilityConditionValue="">
<fields>
<field systemName="Title" />
<field systemName="Text" />
</fields>
</group>
<group name="Image" systemName="Image" sectionName="" collapsibleState="None" visibilityField="" visibilityCondition="" visibilityConditionValueType="" visibilityConditionValue="">
<fields>
<field systemName="Image" />
<field systemName="AltText" />
</fields>
</group>
<group name="Design" systemName="Design" sectionName="" collapsibleState="None" visibilityField="" visibilityCondition="" visibilityConditionValueType="" visibilityConditionValue="">
<fields>
<field systemName="Size" />
</fields>
</group>
</groups>
</layout>
To conditionally show a group based on a checkbox field: set visibilityField to the checkbox's systemName and visibilityCondition to True or False.
Create the template at:
Files/Templates/Designs/Swift-v2/Paragraph/MyPrefix_MyBlock/MyPrefix_MyBlock.cshtml
The template inherits from ViewModelTemplate<ParagraphViewModel>. Access field values via Model.Item:
@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel>
@{
var title = Model.Item.GetString("Title");
var text = Model.Item.GetString("Text");
var image = Model.Item.GetString("Image");
var showTitle = Model.Item.GetBoolean("ShowTitle");
}
@if (!string.IsNullOrEmpty(title) && showTitle)
{
<h2>@Html.Raw(title)</h2>
}
@if (!string.IsNullOrEmpty(text))
{
<div>@Html.Raw(text)</div>
}
Model.Item accessor methods:
| Method | Returns | Use for |
|---|---|---|
GetString("fieldName") | string | Text, RichText, Button, Link, Image, Dropdown — any string field |
GetBoolean("fieldName") | bool | CheckboxEditor fields |
GetInt32("fieldName") | int | IntegerEditor fields |
GetDateTime("fieldName") | DateTime | DateEditor fields |
GetValue("fieldName") | object | When the type is dynamic or unknown |
Note:
Model.Itemis also available onPageViewModelfor page-level ItemTypes. The sameGetString/GetBooleanetc. methods work identically.
Files/System/Items/ItemType_MyPrefix_MyBlock.xmlFiles/Templates/Designs/Swift-v2/Paragraph/MyPrefix_MyBlock/MyPrefix_MyBlock.cshtmlAllowed parents in <rules> to include the Swift parent types where the block should appearcategoryAlternative: ItemTypes can also be created and edited via the admin UI at Settings → Areas → Content → Item types. The admin writes the same XML files on disk — useful for prototyping, but committing the XML file directly is preferable for source control.
Repositories live in Files/System/Repositories/<RepositoryName>/ and contain four file types that form a pipeline: .index → .query → .facets. A .task file (deprecated — prefer a Scheduled Task AddIn) triggers scheduled rebuilds.
Managed in admin at: Settings → System → Repositories
.index — Index definition<?xml version="1.0" encoding="utf-8"?>
<Index Type="Dynamicweb.Indexing.Index, Dynamicweb.Core" Name="Products.index">
<Settings />
<Instances Balancer="Dynamicweb.Indexing.Balancing.LastUpdated">
<Instance Name="Products" Type="Dynamicweb.Indexing.Lucene.LuceneIndexProvider, Dynamicweb.Indexing.Lucene" />
<Instance Name="Products secondary" Type="Dynamicweb.Indexing.Lucene.LuceneIndexProvider, Dynamicweb.Indexing.Lucene" />
</Instances>
<Builds Type="Dynamicweb.Ecommerce.Indexing.ProductIndexBuilder, Dynamicweb.Ecommerce">
<Build Name="Full" Action="Full">
<Setting Name="SkipPrices">True</Setting>
<Setting Name="SkipImages">True</Setting>
<Setting Name="BulkSize">500</Setting>
<Setting Name="OnlyIndexActiveProducts">False</Setting>
<Setting Name="HoursToUpdate">24</Setting>
<Setting Name="HandleInheritedCategoryValues">True</Setting>
<Setting Name="EmptyStringReplacement"></Setting>
<Notification SenderName="" SenderEmail="" Subject="" Template="" SendLog="false" NotificationType="Never" />
</Build>
<Build Name="Partial" Action="Update">
<Setting Name="HoursToUpdate">2</Setting>
<!-- same settings as Full -->
</Build>
</Builds>
<Schema>
<Fields>
<!-- Schema extender — adds all default fields for this index type -->
<Extension Type="Dynamicweb.Ecommerce.Indexing.ProductIndexSchemaExtender, Dynamicweb.Ecommerce"
Stored="false" Analyzed="false" Indexed="false" Facetable="false" />
<!-- Simple field — maps one source field to one index field -->
<Field Source="ProductCategory|brand_information|Brand_name"
Name="Brand_Facet" SystemName="Brand_Facet"
Type="System.String" Stored="true" Analyzed="false" Indexed="true" Facetable="false" />
<!-- Analyzed field for search (not for facets) -->
<Field Source="ProductName" Name="ProductName_Search" SystemName="ProductName_Search"
Type="System.String" Boost="5" Stored="false" Analyzed="true" Indexed="true" Facetable="false" />
<!-- Copy/Summary field — aggregates multiple sources into one searchable field -->
<Copy Sources="Name,Number,LongDescription,ShortDescription,ManufacturerName"
Name="Free text search" SystemName="freetext"
Type="System.String" Stored="false" Analyzed="true" Indexed="true" Facetable="false" />
<!-- Grouping field — buckets a numeric source into named ranges -->
<Grouping Source="ProductPrice" Name="Price Range" SystemName="PriceRange"
Type="System.String" Stored="true" Analyzed="false" Indexed="true" Facetable="false">
<Group Name="1 - 200" From="0" To="200" />
<Group Name="200 - 500" From="200" To="500" />
<Group Name="500 - 1000" From="500" To="1000" />
<Group Name="1000 +" From="1000" To="100000" />
</Grouping>
<!-- Sort field — un-analyzed copy of a field needed for sorting -->
<Field Source="ProductName" Name="NameForSort" SystemName="NameForSort"
Type="System.String" Stored="true" Analyzed="false" Indexed="true" Facetable="false" />
</Fields>
<FieldTypes />
</Schema>
<Meta />
</Index>
| Attribute | Purpose |
|---|---|
Stored="true" | Value is kept in the index and can be retrieved |
Indexed="true" | Field is searchable / filterable |
Analyzed="true" | Value is tokenized (lowercased, split on spaces) — good for full-text, bad for facets |
Facetable="false" | Rarely needed; facetability is controlled in the .facets file |
Boost="5" | Multiplies relevance score for this field in full-text searches |
Key rules:
Analyzed="false" — tokenizing destroys the values and breaks facet counts<Field> alongside any analyzed search fieldEmptyStringReplacement — Lucene does not index null or empty strings; set a dummy value if you need to match "no value" in a query<Instance> elements — the LastUpdated balancer serves queries from the freshest one, so rebuilds never take the index offlineType by index category| Index type | Builds Type |
|---|---|
| Products | Dynamicweb.Ecommerce.Indexing.ProductIndexBuilder, Dynamicweb.Ecommerce |
| Content | Dynamicweb.Content.ContentIndexBuilder, Dynamicweb |
| Users | Dynamicweb.UserManagement.Indexing.UserIndexBuilder, Dynamicweb.UserManagement |
| Files | (FileIndexBuilder) |
| SQL | (custom SqlIndexBuilder) |
Action values| Action | Behaviour |
|---|---|
Full | Rebuilds entire index from scratch |
Update | Rebuilds products modified within HoursToUpdate |
UpdateWithIds | System-triggered batch during product saves in PIM |
ProductIndexSchemaExtender| Category | Field names |
|---|---|
| Identity | ID, VariantID, ProductKey, AutoID |
| Names | Name, Number, ShortDescription, LongDescription, ManufacturerName |
| Navigation | GroupIDs, GroupNames, ParentGroupIDs, ShopIDs, PrimaryGroupSort |
| Status | Active, LanguageID |
| Commerce | ProductPrice, BoughtWithProducts, OrderCount, AssortmentIDs, CampaignStartTime, CampaignEndTime |
| Stock | StockLocationProductAvailable |
| Variants | IsVariant, VariantGroup_VARGRP1, VariantGroup_VARGRP2, … |
| Relations | ProductRelationGroup_RELGRP1, ProductRelationGroup_RELGRP2, … |
| Category fields | ProductCategory|CategorySystemName|FieldSystemName |
| Media | DetailImages, ImagePatternImages, Images |
.query — Query definition<?xml version="1.0" encoding="utf-8"?>
<Query ID="3d8be144-b239-4d10-91c1-e19e0d6e6032" Name="Products.query">
<Meta />
<Settings />
<!-- Parameters — optional filters; expressions are skipped when value is empty -->
<Parameters>
<Parameter Name="q" Type="System.String" />
<Parameter Name="GroupID" Type="System.String[]" DefaultValue="" />
<Parameter Name="IsVariant" Type="System.Boolean[]" DefaultValue="" />
<Parameter Name="Brand" Type="System.String[]" />
<Parameter Name="PriceRange" Type="System.String[]" DefaultValue="" />
</Parameters>
<!-- Source — points to the index this query runs against -->
<Source Repository="ProductsFrontend" Item="Products.index"
Type="Dynamicweb.Indexing.Queries.IndexQueryProvider, Dynamicweb.Core" />
<SortOrder>
<Sort Field="_score" Direction="Descending" />
</SortOrder>
<Expressions>
<!-- AND-group: all children must match -->
<GroupExpression Operator="And">
<!-- Hard filter: always active products only -->
<BinaryExpression Operator="Equal" Disabled="false">
<Left><FieldExpression Field="Active" /></Left>
<Right><ConstantExpression Value="True" Type="System.Boolean" /></Right>
</BinaryExpression>
<!-- Macro: auto-filter to current language -->
<BinaryExpression Operator="Equal" Disabled="false">
<Left><FieldExpression Field="LanguageID" /></Left>
<Right><MacroExpression Lookup="Dynamicweb.Ecommerce.Context:LanguageID" /></Right>
</BinaryExpression>
<!-- Macro: auto-filter to current shop -->
<BinaryExpression Operator="MatchAny" Disabled="false">
<Left><FieldExpression Field="ShopIDs" /></Left>
<Right><MacroExpression Lookup="Dynamicweb.Ecommerce.Context:ShopID" /></Right>
</BinaryExpression>
<!-- Parameter: optional group filter — skipped when GroupID is empty -->
<BinaryExpression Operator="MatchAny" Disabled="false">
<Left><FieldExpression Field="ParentGroupIDs" /></Left>
<Right><ParameterExpression Name="GroupID" /></Right>
</BinaryExpression>
<!-- OR-group: free-text search across multiple fields -->
<GroupExpression Operator="Or">
<BinaryExpression Operator="Equal" Disabled="false">
<Left><FieldExpression Field="ProductName_Search" /></Left>
<Right><ParameterExpression Name="q" /></Right>
</BinaryExpression>
<BinaryExpression Operator="Contains" Disabled="false">
<Left><FieldExpression Field="freetext" /></Left>
<Right><ParameterExpression Name="q" /></Right>
</BinaryExpression>
</GroupExpression>
<!-- Facet filter: Brand — skipped when Brand param is empty -->
<BinaryExpression Operator="In" Disabled="false">
<Left><FieldExpression Field="Brand_Facet" /></Left>
<Right><ParameterExpression Name="Brand" /></Right>
</BinaryExpression>
</GroupExpression>
</Expressions>
<ViewFields />
<ViewLanguages />
<Meta />
<CompletionRules />
<CompletionLanguages />
<ListViewFields />
</Query>
| Type | Usage |
|---|---|
System.String | Single value (search term, ID) |
System.String[] | Multiple values — all facet filters use this |
System.Boolean[] | Multiple booleans (e.g. IsVariant) |
System.Int32 | Single integer |
System.DateTime | Single date |
DefaultValue="" — expression is skipped when no value is passed (the standard pattern for optional filters)DefaultValue — expression only fires when the caller explicitly provides a value| Operator | Behaviour |
|---|---|
Equal | Exact match; if test value is an array, acts like MatchAll |
MatchAny | Field contains any of the test values |
MatchAll | Field contains all of the test values |
In | Array-only MatchAny — standard operator for System.String[] facet parameters |
Contains | Partial match from the beginning of the value |
ContainsExtended | Partial match anywhere — high overhead, use sparingly |
IsEmpty | Field is empty or unset |
| XML element | Usage |
|---|---|
<ParameterExpression Name="..."> | Value comes from a query parameter (URL / facet) |
<MacroExpression Lookup="..."> | Dynamic context value — language, shop, user, assortments |
<ConstantExpression Value="..." Type="..."> | Hardcoded value |
<TermExpression Value="..." Type="..."> | An existing known field value |
Common macros:
| Macro | Returns |
|---|---|
Dynamicweb.Ecommerce.Context:LanguageID | Current language ID |
Dynamicweb.Ecommerce.Context:ShopID | Current shop ID |
Dynamicweb.Ecommerce.Context:AssortmentIDs | Current user's assortment IDs |
Dynamicweb.Frontend.PageView.Context:WebsiteID | Current website/area ID |
Dynamicweb.UserManagement.Context:FavoritesAutoIdByUserId | Current user's favorited product AutoIDs |
Direction: Ascending or DescendingField: any index field — must be Analyzed="false" to sort correctly_score is the Lucene relevance score field (default for search results).facets — Facet definition<?xml version="1.0" encoding="utf-8"?>
<Facets Name="Products.facets">
<Settings />
<!-- Source — points to the query (not the index directly) -->
<Source Repository="ProductsFrontend" Item="Products.query" />
<Meta />
<!-- Field facet: one option per unique value in the index field -->
<Facet Name="Brand" Type="Field" Field="Brand_Facet" QueryParameter="Brand">
<RenderType Name="Checkboxes" SystemName="Checkboxes" />
<Visibility Status="AlwaysVisible" QueryParameter="" Condition="HasValue" MatchValue="" />
</Facet>
<!-- Colors render type -->
<Facet Name="Color" Type="Field" Field="VariantGroup_VARGRP1" QueryParameter="Color">
<RenderType Name="Colors" SystemName="Colors" />
<Visibility Status="AlwaysVisible" QueryParameter="" Condition="HasValue" MatchValue="" />
</Facet>
<!-- Conditional visibility: only show when another parameter has a specific value -->
<Facet Name="Gear model" Type="Field" Field="GearModel_facet" QueryParameter="Gear_Model">
<RenderType Name="Checkboxes" SystemName="Checkboxes" />
<Visibility Status="Conditionally" QueryParameter="Bike type" Condition="HasSpecificValue" MatchValue="Mountain" />
</Facet>
</Facets>
Type values| Type | Behaviour |
|---|---|
Field | One option per unique value in the index field — standard |
List | Groups values under custom labels (e.g. "Spring Colors" containing several values) |
Term | Auto-generates from the 2048 most frequent values — for high-cardinality fields like tags |
RenderType options (defined in FacetRenderOptions.xml)Checkboxes, Colors, Range, Select, Tags, Icons, Images, Links, Number
Visibility settings| Status | Behaviour |
|---|---|
AlwaysVisible | Always shown |
Conditionally | Shown only when QueryParameter satisfies Condition |
Condition values: HasValue (any value selected), HasSpecificValue (matches MatchValue)
Field must exist in the index schema as Analyzed="false" Indexed="true"QueryParameter must match a <Parameter Name="..." Type="System.String[]"> in the queryIn in a BinaryExpression&Color=[Red/Orange]&Color=[Blue, Navy].task files trigger index builds but are officially deprecated. Timing is imprecise (handler runs every 5 minutes).
Recommended approach: Use a standard Scheduled Task with the Repository build index AddIn — supports selecting the index and build type (Full/Partial) with reliable scheduling.
Legacy .task file format for reference:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Task Type="Dynamicweb.Indexing.Tasks.IndexBuilderTaskProvider, Dynamicweb.Core"
Start="1992-12-31 07:00:00" End="2999-12-31 23:59:59" Repeat="1440">
<Parameters>
<Index>Products.index</Index>
<Build>Full</Build>
</Parameters>
</Task>
Repeat is in minutes (1440 = daily).
When generating code, always:
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub dynamicweb/ai-implementor-skills --plugin dw-extend