domain_settings
This module component retrieves settings associated with the current domain, or optionally from another specified domain configured in the site instance.
This component can be output throughout all site content areas and emails with the retrieved settings including things like the domain's default landing page, country, culture and currency attributes.
{% component type: "domain_settings" %}
Parameters and Options
domain_settings
This is the name of the entity that needs to be used for the component retrieving function.
<YOURDOMAIN.COM>
Leaving out this parameter, or leaving the value empty, will result in the current domain used as default.
<yourLiquidVariableName>
Your collectionVariable value must only contain English letters, numbers or underscores. Spaces or special characters are not supported.
Liquid Output
The below example shows the domain settings available for the site. The Liquid data output from this example would look like the following (for example, when using a collectionVariable
to create the collection):
{
"Domain": "treepl-docs-v7.treepl.co",
"Country": {
"Name": "UNITED STATES",
"Code": "US"
},
"LandingPage": {
"Id": 1865,
"Url": "/documentation",
"Name": "Documentation"
},
"FormatSetting": {
"Id": "2231",
"Name": "USD",
"Culture": "en-US",
"DecimalsQuantity": 2,
"Currency": {
"Code": "USD",
"Symbol": "$",
"DigitalCode": "840",
"Name": "US Dollar"
}
},
"Params": {
"type": "domain_settings",
"collectionvariable": "domainCollection"
}
}
The data exposed is explained further in the table below:
Accessing the Data
JSON Output
You can output the full JSON for your component data by referencing the root Liquid object {{this}}
in your module’s layouts, or directly on your page, if using the collectionVariable
parameter in your component tag.
For example:
{% component type: ... collectionVariable: "myData" %}
You can then render the JSON like so:
{{myData}}
For more details on using this approach, see Part 2 of the free ‘Learning Liquid Course’.
Rendering Property Values
There is no default or virtual layout for this component. It is purely a data object for Liquid usage.
This data is accessible directly on the Page or Template via a Liquid Collection by adding collectionVariable
to the Component.
An example using collectionVariable
with value "domainCollection" for the current domain:
{% component type: "domain_settings", collectionVariable: "domainCollection" %}
Accessing a specific item within the collection. In this case the currency name, which in our example would render the value US Dollar
{{domainCollection.FormatSetting.Currency.Name}}