Search page results for a specific metadata value


(Kenny Cameron) #1

Matrix Version: 5.5.6.7

Hello. I’ve been trying to build up a search page that lists only image assets that do not contain a value for asset_attribute_alt, as we have quite a few images uploaded with no alt text. I searched around the forums a little and found that creating an additional metadata field and setting it to the value of the attribute should work, then I can create a search based on that. Think I’m about 90% there, but just can’t get over the last hurdle :slight_smile:

This is my setup:
I created a fresh metadata schema that has 1 text field inside it.
I set the value of that field to %asset_attribute_alt^empty:noalttext% – so it gets filled with ‘noalttext’ if the attribute is empty. I applied the schema just to a single image for testing.

I then created a search page and set up my search field as follows, selecting the custom metadata field I created (noted above).

On the details screen I set my root node, specified only image assets, showing the results screen immediately and then after this is pretty much where I got stuck. This is my current stored query attempt, which kind of works.

The search results from this do pull back the single image that has the schema applied, but if I update the alt attribute of that image with some text it still shows in the results rather than it not being returned. Just not sure what I need to set up on that section to pull the right results back based on my query.


#2

If matrix indexes the keyword text and not the calculated keyword value, which I suspect it does, that would explain why it always returns.

I think whenever I’ve needed to do things like this I’ve used an asset listing with conditions that either highlight the entries you want, or output nothing for those that you don’t.
https://matrix.squiz.net/manuals/asset-screens/chapters/conditions


(Kenny Cameron) #3

It certainly spits out the calculated value, but yeah I was afraid this might be the case.

Asset listing was where I started initially, just hiding rows that I didn’t want to show. But even doing a begin/else messes up pagination and doesn’t let me get an accurate [total] count of assets I’m printing out.

Both methods get me so far lol. Another factor is the amount of assets I’m polling - close to 6000, which Matrix just doesn’t seem to like sometimes.


#4

Given that, an external tool is likely appropriate. If your licence includes funnelback, it has an accessibility auditor that will address this specific issue.


(Kenny Cameron) #5

Thanks, I’ll check in with my team about potentially using Funnelback for this. We have a licence, but I haven’t had much time with it yet.


(Nick Papadatos) #6

Why not go back to creating asset listing page and set the deign to CSV. Add whatever values you want then a TRUE/FLASE (does it have alt text condition) if the asset has alt text? That way you can filter out the ones that are false and have a printed version as well.


(Kenny Cameron) #7

That was the eventual plan, spit out a report and then be able to export to CSV. I hit resource/memory issues this way, unfortunately, haven’t had time to look into it deeper (likely just due to the amount of assets I’m trying to pull through)


(Nick Papadatos) #8

Oh ok, cant you then do a comma seperated list (returning smaller chunks) ie; …your-asset-lister?id=12,345,678 - dynamic root nodes etc. Each call can then be a worksheet tab


(Kenny Cameron) #9

Will add this to the list to give a try as well, thanks!