Asset Grouping Using an Asset Listing


(Nick Papadatos) #1

Matrix Version: 5.5.4

Hi squiz folk,

I have an asset listing using asset grouping (Group Level 1: Asset Metadata)

If I use metadata field 1, 2 and 3 I get the desired response but these are all grouped together and I can’t seem to work out how to group them separately by region type and year.

The only way I was able to do this was to create 3 separate asset listers.

Each one has the following:

Region:

     <li class="facet-item %group_name^lowercase% d-block">
         <a class="facet-link" href="./?a=430661?etype=%group_name^lowercase%">%group_name%</a>
         <span class="badge badge-info">%group_total_child_asset_count%</span>
    </li>

Type:

<li class="facet-item %group_name^lowercase% d-block">
    <a class="facet-link" href="./?a=430661?etype=%group_name^lowercase%">%group_name%</a>
    <span class="badge badge-info">%group_total_child_asset_count%</span>
</li>

Year:

    <li class="facet-item %group_name^lowercase% d-block">
        <a class="facet-link" href="./?a=430661?etype=%group_name^lowercase%">%group_name%</a>
        <span class="badge badge-info">%group_total_child_asset_count%</span>
    </li>

So my question is can I achieve thew above by using just the one asset lister?

Cheers
NickyP


(Bart Banda) #2

Hey Nick, so you have 3 separate metadata fields and you want to list assets and group them by the values each one has in each field? What would the final output ideally look like?

Can you share a mockup?


(Nick Papadatos) #3

What I’m hoping for is:

Region:
Noth (3)
South (10)

Event type:
event type 1 (10)
event type 2 (3)

Year:
2020 (13)

(current live version) using the 3 listers

Possible without SSJS?
Cheers
Nick


(Bart Banda) #4

You might be able to do it by passing dynamic parameters down to the asset listing and nesting the same one in each time, but it might be easier with a search page actually… :thinking:

With SSJS it should def be easy. Any reason you don’t want to use SSJS for this?


(Nick Papadatos) #5

Thanks Bart,

Haven’t used much SSJS, so I’m a tad rusty. Can you give me a leg-up?

Cheers
NickyP


(Nick Papadatos) #6

I think I have something in that it works using SSJS but am not sure how to post the solution.

Cheers
Nick


(Bart Banda) #7

Hey Nick, good to hear you found a solution on your own.

Could you simply paste the code in a comment here using the “code” formatting tool in the comment block?

image

Or alternatively, just upload a text file with the code in it?