Why doesn't %begin..% %else..% %end..% work in the default format of an asset listing?


(Buttrose) #1

Consider this:

 

%begin_asset_metadata_RAD.display^contains:display%

 

<div class="activity">

    <p>%asset_metadata_RAD.activity%</p>

</div>

%else_asset_metadata_RAD.display^contains:display%

    %asset_contents%

%end_asset_metadata_RAD.display^contains:display%

 

 

On the value of the metatdata field RAD.display, this code displays some metadata or alternatively the asset contents.

 

Works perfectly in a paint layout, but as the default format of an asset listing the %begin.." keyword is not recognised , even though the value %metadata_RAD.display^contains:display% is clearly picked up.

 

Why is this? This looks like a fundamental oversight ,one of the many Matrix things that should work, but doesn't.

I have another -- see my next post.


(Aleks Bochniak) #2

use %asset_contents_paint_XXXX% keyword in your default format to use the paint layout you created (XXXX is the assetid of the paint layout asset)


(Buttrose) #3

Yes that's the answer - worked it out just after I posted. Thanks.


(Bart Banda) #4

they should work in that format though, what version of matrix are you using? perhaps its a bug that was fixed in a later release?

 

Also, I'm pretty sure you need true/false parameter values in your modifier for contains if you are using it like that? E.g.

 

%begin_asset_metadata_RAD.display^contains:display:TRUE:%