Hey all, just working on a solution to display a list of members whose birthday falls on the day the page is accessed. The date of birth is stored in a metadata field, in the format 'd-m-Y'
I was hoping to stick a nested search page in looking for the d-m bits of globals_date. My problem is that unless I also search the Y, nothing matches, even when selecting any instead of all on the matching rule. I can't search every year, so anyone run into something similar before?
I think you'd need to turn on "Enable Contains Search", which will increase the index size of the system quite a bit I think and can slow down searches across the board, you'd then have to re-index as well.
If that is not viable, you could potentially have another metadata field that references the first one and strips the last -Y part using a keyword modifier and search on that value instead, might be a better solution.
Thanks for your reply Bart, I like the second option. One solution I was toying with was to use a datetime trigger to set a metadata value on the day of the birthday, so the search could just search for a constant term, but the problem is the trigger needs d-m-Y h:i:s - to your knowledge, are there any workarounds where I could use globals_date^date-format:Y to replace the Y in the dob field?
to your knowledge, are there any workarounds where I could use globals_date^date-format:Y to replace the Y in the dob field?
Not sure what you mean by this?
If your current DoBs are stored as d-m-Y, you could easily use a modifier on that to leave you with d-m by using %metadata_field_<dob_field_name>^maxchars:5%
As its safe to assume that you will always have 5 chars for the d-m part, 01-01
Not entirely sure how efficient the method I'm outlining below would be (also not how if there would be be any version dependancy), but should return the data you need:
Use an asset listing to list all the assets containing the member metadata.
Create a paint layout to apply to the listing's default format.
In the layout add a logical condition that returns true if matched - which will be a combination of keywords - one for day part, and one for month part:
If the date is stored in metadata as an actual date - the logical conditions would be: