Keyword for the asset name of the nested content to use in Paint Layout


(Emily) #1

Matrix version: 5.3.2.1

I have a Standard Page, which has a Nested Content Container. That container is nesting a News Item. The container also has a Content Container Template applied to it - which just applies a paint layout*.

In the Paint Layout which is being applied via the Template, I am trying to get it to output the Asset Name of the asset that is being nested into the Nested Content Container.

*This is because editors in Edit+ cannot add a Paint Layout using the Asset ID; it would have to be a pre-defined PL in the dropdown list. However, they can apply a Template to the container in Edit+.

Sounds simple. But I just can’t get the right keywords combination. I am wondering if I need to use GET or POST to achieve this??

  • asset_name displays the asset name of the Nested Content Container.
  • globals_asset_name displays the name of the Standard Page.
  • nested_asset_name does not compute (blank/empty result). (I assume thus that this can only be used ON the nested content container itself).

Thank you for any help/ideas :slight_smile:


(Bart Banda) #2

If you need to use a Content Template then perhaps just set up a metadata related asset field in a metadata schema and apply that to the template. Then the users can just use a wysiwyg content container, select the template to apply, and use the asset picker in the related metadata field to pick the news item. Then in the Paint layout of the content template you reference that related metadata field and use the ^as_asset keyword modifier to pull any data from the news item.

For example:

%asset_metadata_related-asset^as_asset:asset_name%


(Emily) #3

That’s an interesting idea… I had been hoping there may be a way to do it more directly (e.g. Keywords, GET/POST) - with less layers of set up, but if not, this may work. :slight_smile:

The metadata screen for the Content Container however, can that be accessed in Edit+?
The editors will only be using Edit+, not the admin backend (which is why a PL isn’t being applied).

If not accessible via Edit+, I suppose this also might work as a work-around:

  • PL on the CCT just has the %asset_contents_paint_% keyword, and then that PL being referenced can hopefully see the nested item in order to use %nested_asset_% keywords…

I will have a fiddle and see. :slight_smile:


(Bart Banda) #4

Yes, the metadata fields in a CT applied to a container are available in Edit+ by default, so this shouldn’t be an issue.