kreitttbw Posted January 29, 2021 Posted January 29, 2021 Can anyone help me find a way to add the date/time of publishing a new record to a database inside the display title? I found a few things in the community on formatting fields and this for formatting date/time settings, but can't seem to figure out how to implement it in my field. What I would ultimately love to have happen, is for the title to auto-generate: "RR-1/29/2021-6:49a" to each record I add for that specific category, "routine reviews." I'd like this to be uniform across all entries, and these will be made by several members of my team, so I don't want to leave it to chance that everyone will format it as directed. I want these formatted this way since they will be linked to records and a date/time stamp on title would be best for quick reference when reviewing records. Does anyone have any suggestions? I appreciate your help!
CoffeeCake Posted January 29, 2021 Posted January 29, 2021 You may want to consider making these discrete fields that are then combined on display via a template modification in the manner you'd like. So, a date field, a category field perhaps that's a selectable list including "RR." That way, in two years when you decide a better format may be a more appropriate "title," you can simply change the output formatting on your template to reorder or append the additional fields that now are important to you. kreitttbw 1
kreitttbw Posted January 29, 2021 Author Posted January 29, 2021 30 minutes ago, Paul E. said: You may want to consider making these discrete fields that are then combined on display via a template modification in the manner you'd like. So, a date field, a category field perhaps that's a selectable list including "RR." That way, in two years when you decide a better format may be a more appropriate "title," you can simply change the output formatting on your template to reorder or append the additional fields that now are important to you. First, thank you for your response. To ensure I understand fully, you recommend creating the fields I want the title to include, then modify the template with this: {$record->customFieldDisplayByKey('your_template_key', 'viewtype')|raw}, using the fields I'd like in the order I'd like them. Am I understanding you correctly?
kreitttbw Posted January 29, 2021 Author Posted January 29, 2021 4 minutes ago, Paul E. said: Something like that, yes. Will start work on this, thanks for your suggestion!
Recommended Posts