Display different assets based on metadata


(Neil) #1

5.3.4

Hello-

I’m new to Squiz and my first real tax is to create an employee benefits page where the employees are shown different offers based on which part of the organisation they work for.

I’m trying to create a folder of Data Records that contain the offers as metadata. Then use a asset listing page to say something like “this person is an employee of this company and a teacher” show them all adverts tagged for teachers and that employer. (We have metadata set for each user that can show their employee types)

Does this sound possible using asset listings? I feel that this should be very possible but am having trouble finding the right approach. Any pointers appreciated.

Thanks


(Bart Banda) #2

Hello,

Yes, you can do this, but you would need to use a Search Page asset instead of an Asset Listing.

So you would set up the Search Page to search on those metadata fields, and then go to the Details screen of it and turn on Stored Search and pass it a couple of default search values for those fields. These values can be metadata values sourced from the current logged in user in your case.

That way the search would effectively do an automatic search for you when you load the page, as in show the search results page format already without having to do a manual search first.

Have a look at https://matrix.squiz.net/manuals/search/chapters/search-page#stored-search for more info.

Hope that helps.


(Neil) #3

Hi Bart

Thanks for replying. In theory that’s great and seems to be working ok.

One thing, the search query returns the keyword %result_list% .

I there anything you can do to iterate through there and show the metadata from each of the Data Record items that are returned?

This is for an employee benefits page and we don’t wan the users to have to click through each offer but just have all the suitable ones listed for them to browse.

Thanks, Neil


(Bart Banda) #4

Not sure what you mean by this? Are you wanting to add some additional functionality or information on the search results list for each listed result? In that case, wouldn’t you just add some custom JS or configure the layout of the Type Format layout of the Search page?


(Neil) #5

You’re right, I was being an idiot. Thanks.