Parent configs
A very useful tool when dealing with multiple In-Depths stories is a parent confuguration. Using a parent let's you configure one in-depth story but have those choices cascade to others.
Define it once. Use it in many places.
This could be useful for
- Series
- Theme
- Storytopper
- Credits
- Highlights
Configuring a parent
Config inheritance requires two In-Depth articles:
- The parent article is the home for all the configuration options you want other articles to use.
- Child articles inherit configuration from their parent.
Config inheritance behaves in a similar way to cascading style sheets (CSS). By default, a child article will adopt all configuration from its parent. This includes theme color, topper styles, series configuration ... everything except assets (more on that later).
The child takes priority
The child config takes priority over the parent. If both the parent and child set a themeColor
in the {theme}
block, then the child's theme color is used. Inherited properties are overwritten by child properties.
Only the parent's published config is inherited. Draft changes remain exclusive to the parent's preview.
Fine-tuned control
To only share some of a parent config, the child configuation can identify only the pieces to be inherited by providing a bulleted list of blocks to include.
Conversely, you can choose to have a child inherit everything except certain blocks by defining a bulleted list to exclude`.
The include
and exclude
features are mutually exclusive. The exclude
list will be ignored if theinclude
is configured. Only use one or the other. They're not meant to be used together.
In-Depth configs use ArchieML, and lists to include
or exclude
should be provided as bulleted lists with asterisk (*
) as the bullet:
[.include]
* theme
* storytopper
[]
Inheriting assets
Assets are treated seperately from the rest of a config. You can choose to inherit configuration for specific assets only (versus all the parent assets). Like include
or exclude
, you do this with a bulleted list.
[.assets]
* 34657863
* 347895743
* *
[]
The global asset config is marked with an asterisk (*
) and can be added to the asset list like any other presto ID. Presto assets from the parent are not added to the child article, only the configuration. Shared assets need to be added to each and every story in presto.
Configuration options
Parent options should be placed in a {parent}
block.
key | purpose | required | default |
---|---|---|---|
id |
The presto ID of the parent config | yes | - |
include |
A list of the config blocks that should be included. When using this feature, anything not on the list is not included. | No | All of them |
exclude |
A list of the config blocks to exclude from inheritance. Excludes will not override includes. | No | None of them |
assets |
A list of asset IDs to pass along to the child. This includes the global config, using the asset ID * |
No | No assets are included |
No grandparents!
Parent configs cannot, themselves, have a parent. This is done intentionally to preserve rendering performance and guard against infinite loops. If you don't know what an infinite loop is, rest assured it's worse than it sounds.
Example
This example inherits only the topper and theme configurations from the story with presto ID 12345545464
. It also inherits the configuration of two assets and the global asset configuration.
{parent}
id: 12345545464
[.include]
* storytopper
* theme
[]
[.assets]
* 746893745
* 478974895
* *
[]
{}
The double asterisk in the asset list above is for the global asset config.