Updated example:
NOTE: I have a very complicated and large parse file. I’d like to move some of the show_if blocks out of the parse file and into nested assets or paint layouts.
This is how I’d like the functionality to work.
In my parse file, I have a declared vars block like so:
<MySource_AREA id_name="cascading_default_blocks" design_area="declared_vars" print="no">
<MySource_DECLARE name="block_1_asset_id" value="" type="text" description="ID of asset to be used as default content for block 1 (can be over-ridden by metadata)" />
</MySource_AREA>
In my paint layout I have conditional keywords to use custom or default nested assets:
%begin_asset_metadata_block_1_id%
%asset_metadata_block_1_id^as_asset:asset_contents_raw%
%else_asset_metadata_block_1_id%
%declared_vars_cascading_default_blocks_block_1_asset_id^as_asset:asset_contents_raw%
%end_asset_metadata_block_1_id%
Using this method, I can pull out single (and nested) show_if blocks used for cascaded nested content.
NOTE: cascading metadata values is not a viable alternative because:
- if you update a metadata value on an ancestor and cascade the new value, if that value is overridden on decendant the cascade may wipe out the decendants override.
- Also if an asset is temporarily archived the cascade won’t apply to arcived decendants so when that asset is made live, it won’t have the current metadata value.
- The other thing about cascading a metadata value is that for our site like ours, which can have tens of thousands of decendant assets, the HIPO required for such a cascacde WILL fail if it can even start.
(The schema is applied to hundreds of thousands of assets.)