Hi squiz folk - I’m trying to list all assets created by a specific user with when logged in with a nested search asset. I kind of have it working but noticed in the list I have 1 that wasn’t created by me so I’m wondering A: Is this possible and B: is my setup incorrect.
What I have:
A standard page which acts as the front end display nesting the search asset.
Search asset:
Search fields > author > data sources: Include all > word logic: All words
Stored query location: Search Field: author > set value: %globals_user_name%
So in theory the search should return assets based on name? I’ve tried %asset_created_by_ email, name, assetid but I’m still not getting the same results. If I change the word logic to any words I get ones that I created as a test but doesn’t explain why I’m getting some that I created in the past and getting some that I haven’t created.
Apologies for the wordy explanation but am hoping someone can help!
BTW - I originally had standard pages with the metadata values of the authors name which worked but am trying to minimise the workload by having one asset doing the work of potentially 10 or more…
Now I’m finding the asset count is out of wack - shows the total assets. Is there a keyword modifier to the %asset_count% based on the assets created by the user? (that’s where the search asset is great)
Def still try and use a search page, as an asset listing would be intensive as it has to load all other assets that weren’t created by you.
Is your search manager set to use “Enable Contains Search”? If so, maybe you are getting results other than yours because other people’s names start with the same string?
You could try and search for 2 values, for example user asset ID and Username and make the search page match logic match on ALL fields?
Agreed Bart about search vs Asset listing - I did it more for testing the keywords across both assets.
Can confirm, search manager is set to “Enable Contains Search”
Two values like so? details screen > set value > %globals_user_name^as_asset:{user_asset_id}%
Any assistance is welcomed - am pulling my hair out…
Ah, sorry, I got confused, yes off course, you can’t add the user’s username as a field then if you are searching for Standard Pages (doh!)
So what you need to then do, is to create a metadata text field that has %asset_created_by_assetid% as the default value, can also make it non-editable. Then use that as the field to search on in the search fields.
Ok, starting to make sense but but I was hoping that all the user has to do (private not public facing) is to navigate to mysite.com.au/admin/my-dashboard so when they login then Matrix knows who the user is and just pre populates the list based asset created by that particular user without having to do a search. so I need to set the values in the stored query locations?
Nah, you don’t need it. What you have there should be enough.
The only thing to consider is the unlikely case of 2 users having the same starting asset ID. For example:
1234
12345
With “Enable Contains Search” on, this would make the search pick up pages by both those users.
The fix for this is to change the metadata field to be something like “X%asset_created_by_assetid%X” and then your stored search value be “X%globals_user_assetid%X”.