I'm writing an asset listing that can handle multiple asset types, outputting slightly different information for each type (e.g. news vs event etc). So far easy... but unfortunately I also need certain positions to be formatted differently, for example the first entry in the list to have a larger thumbnail image etc.
As far as I an tell, if you define a position format for an asset listing, it completely overrides the type format that would otherwise match for that asset... can anyone confirm that's the case? And the position format doesn't then have an option to do different things depending on the type of asset its rendering?
I'm sure I can find a way to work around it - I'll probably use two asset listings and have the first one limit to show just the first result. Or maybe nesting a paint layout that can have different type formats? Any tips gratefully received!
You can also do some tricky stuff with keywords from the asset listing, so that the first item gets a different class for example to all the other ones.
<li class="position-%asset_position%">
<img src=""/>
..other stuff...
</li>
Then you can target the first item with css easily,
On your asset list, set your position format to output %asset_contents_paint_123% and then your default format to output %asset_contents_paint_456%
Then your paint layout #123 would have type formats for your events, news etc, but all with the bigger thumbnail pic and other 'top item' styling. And your paint layout #456 would again have type formats for your events, news etc, but with the simpler styling needed.
You mentioned events though - and as far as I know you can't use the _paint keyword with an event asset (or at least not in my version of Matrix, maybe you can in the latest one) so you'd need to check that.