The Brand Theme Selector (BrandThemeSelector) Data Block is a System Data Block and cannot be deleted.
The Brand Theme Selector (BrandThemeSelector) Data Block is a Transform Data Block in Assette designed to return the appropriate brand theme name for a given product. This block supports branding logic for product-specific themes by retrieving brand theme values from a source and returning the matching entry based on a provided product code.
While the BrandThemeSelector Data Block is not required to use Brand Themes, it is required if firms plan on using the Dynamic Brand Themes.
General Info #
Field | Value |
---|---|
Name | BrandThemeSelector |
Block Category | Transform |
Block Type | Python |
Output Type | Text |
Editable | True |
Dependencies #
This block depends on the following Data Blocks. These dependencies must be published and valid in the environment for this block to function correctly.
Data Block | Description |
---|---|
CalculationEnv | Provides runtime environment variables or global configuration. [Link] |
BrandThemeExtract | A Data Block that returns a list of available brand themes, each associated with a specific product. [Link] |
Example Definition #
Product=""
if(params.__len__()>0):
Product = params.get("ProductCode") or ""
BrandThemes = read("BrandThemeExtract", {})
BrandThemes = BrandThemes.get("data") or []
MatchingBrandTheme = {}
BrandThemeName = ""
if len(BrandThemes)>0:
for BrandTheme in BrandThemes:
if (BrandTheme.get("Product") or "") !="":
if (BrandTheme.get("Product") or "")==Product:
MatchingBrandTheme = BrandTheme
break
if len(MatchingBrandTheme)>0:
BrandThemeName = MatchingBrandTheme.get("BrandThemeName") or ""
response["text"] = BrandThemeName
How to Use This Block #
The BrandThemeSelector Data Block is used for Dynamic Brand Themes— allowing branding to change based on the selected product. This ensures that documents reflect the correct visual theme or layout aligned with the selected investment product.
Example scenario:
- A fact sheet or client report dynamically selects colors, fonts, or logo placement based on the output of this block.
- The theme name returned by this block is used to trigger a corresponding theme setup in a presentation template.
Best Practices #
- Ensure that BrandThemeExtract contains accurate and up-to-date mappings of products to brand themes.
- Limit the number of themes to only those required, to keep performance optimized.
- Use clear and consistent naming for
ProductCode
andBrandThemeName
values for easier maintenance. - When editing this block, maintain the basic structure of the logic to preserve compatibility with downstream systems.