Page 1 of 1
LISE expire item based on custom fielddef date
Posted: Fri Jul 26, 2019 11:27 am
by rbaby
I have a datetime field definition for an event date and I'd like to essentially expire it after this date has passed. I'm not using the "timed control" feature because I can't seem to make that a required field.
a) How do I make the summary templates and detail templates remove this record after the set expiry date at the end of the day?
b) How do I get search to remove/not index it as well?
c) Is there a way to set the record to not be active after it expires?
Optionally... is there a way I can make "Timed Control" required so that I can leverage its pre-existing logic?
Thanks in advance for your time.
Re: LISE expire item based on custom fielddef date
Posted: Fri Jul 26, 2019 3:55 pm
by DIGI3
You can use probably use module_custom to edit the module templates and add the required parameter.
If you'd rather do it with the field in your form, you'd just update your templates to compare the chosen date to $smarty.now and skip the item if it's expired.
Re: LISE expire item based on custom fielddef date
Posted: Fri Jul 26, 2019 5:44 pm
by rbaby
Thank you DIGI, would that be sufficient in ensuring that it wouldn't be searchable?
Re: LISE expire item based on custom fielddef date
Posted: Fri Jul 26, 2019 5:47 pm
by DIGI3
No, not really. It would just output a blank page (or whatever you put in the {else} part of your template). Simplest would just be having it say "this content is no longer available" and perhaps add a meta no-index tag to the page.
You could get creative and have your template update the page headers to 404 with a udt/plugin but at that point it's probably better to just customize the module.
Re: LISE expire item based on custom fielddef date
Posted: Fri Jul 26, 2019 5:51 pm
by rbaby
Sorry for being unclear, I meant the CMSMS search

.
Re: LISE expire item based on custom fielddef date
Posted: Fri Jul 26, 2019 5:55 pm
by DIGI3
That'd be more difficult. You could exclude them from LISE search/filtering, but for CMSMS search you'd need to get more creative. Either a udt on a cron job, or some customization of the CMSMS search results template, having it do checks on every returned result. Not ideal.
I think just adding the required parameter to the existing expiry fields via module_custom is going to be far easier. You can then make a feature request (and sponsor it, if possible) to have the ability to make that field required in future LISE versions.
Re: LISE expire item based on custom fielddef date
Posted: Fri Jul 26, 2019 6:12 pm
by rbaby
I would love to sponsor a few new features--how do I that?
Re: LISE expire item based on custom fielddef date
Posted: Fri Jul 26, 2019 6:14 pm
by DIGI3
You need to contact the module's author, JoMorg. He's in the Slack channel quite often so you can @ him on there, message him through this forum, or check the module help to see if there's a contact email address.