Calculated field for content type based on dateOfIntroduction field

12 views
Skip to first unread message

Jeffrey Schultz

unread,
Feb 8, 2023, 11:23:12 AM2/8/23
to dotCMS User Group
Does dotCMS support the ability for me to add a calculated field to a Content Type that uses another field within that Content Type to convert a dateOfIntroduction timestamp into a label, such as Tier 1, Tier 2, etc.?

How would this be done so that the content data comes back with this field in the JSON?

Mark Pitely

unread,
Feb 8, 2023, 11:31:04 AM2/8/23
to dot...@googlegroups.com
Your question isn't perfectly clear, but I will take a stab at it.
If you are just using the backend, you can put in arbitrary js via a custom field that will allow for calculations and updates.
The js you use there can also talk to the API, to either read in other fields/structures or write back to the API.
If this is not enough, you can just write code in java or js or velocity (or some combination) and make *any* sort of app you like - dotCMS can work 'headless'. 
I can routinely do things like make an SQL query against my school db to build a list of 'active departments' for a drop down or something like that in the dotCMS backend that my users use and they do not notice.  
Now, 'out of the box' and 'without code', no, you cannot do what you are asking. 


Mark Pitely
Albright College

On Wed, Feb 8, 2023 at 11:23 AM Jeffrey Schultz <jeffreys...@gmail.com> wrote:
Does dotCMS support the ability for me to add a calculated field to a Content Type that uses another field within that Content Type to convert a dateOfIntroduction timestamp into a label, such as Tier 1, Tier 2, etc.?

How would this be done so that the content data comes back with this field in the JSON?

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/7f66f491-b067-4358-8869-6be9b6faf166n%40googlegroups.com.

Jeffrey Schultz

unread,
Feb 8, 2023, 11:38:00 AM2/8/23
to dotCMS User Group
Thanks, Mark. I think your response answers my question. 

I just needed the ability to have a field that isn't editable, and that derives its value from another field within the Content Type to produce a label based on say a timestamp.
Reply all
Reply to author
Forward
0 new messages