Product themes

Products may require additional html head material – CSS and JavaScript – to function correctly. This head material needs to be made available to users of the product.

The head material needs to be packaged as one or more Themes. These themes should only contain the material required by the product (not an entire theme), should be triggered by classes specific to the product, and should work across different visual styles. The themes can then be listed on the Product theme list field of the product builder, which are copied to the product.

If a product has product themes, then the subscription will have the tag Subscription with product theme set. This is identified by the account node, which uses it to maintain an Extended Account Theme node within the account. Subscriptions with themes are automatically added to the account theme node by the Register Product Theme Service. These are used to derive a theme for the account. The account holder can change the order in which the subscriptions are applied and can remove subscriptions from the list.

The account theme selected by the user is automatically replaced by the account theme node. From the user perspective, they can continue to select a visual style for the account, and product themes will automatically be added to this.

If no account theme has been set, the extended account theme will be based on the "defaultTheme" binding resolved relative to the account node, or, if that does not exist, the Metrici theme.