Skip to:

Opened 10 years ago

Closed 10 years ago

#5495 closed enhancement (wontfix)

Calculated custom fields

Reported by: sooskriszta's profile sooskriszta Owned by: djpaul's profile djpaul
Milestone: Priority: normal
Severity: normal Version:
Component: Extended Profile Keywords:


More often than not, we just need to display the custom fields.

In the case of some fields, though, we'd like the user to enter one value and for BP to display another value.


  • The user enters date of birth. BP calculates and displays age in years (today - dob)
  • The user enters address. BP calculates and stores latlong. A plugin displays a pin on a map.
  • The user enter his per hour coding fee. BP calculates and displays a percentile standing (coder is more expensive than 70% of coders on this site). Or a plugin displays how expensive the coder is visually (same way as restaurants are often depicted with $, $$, $$$ etc in listings)

While the number of fields that would fall into the "calculated" category is probably small, I suspect that the feature would be useful for a lot of folks.

Change History (2)

#1 @sooskriszta
10 years ago

  • Owner set to djpaul
  • Status changed from new to assigned

#2 @boonebgorges
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from assigned to closed

This would be fairly easy to do for specific cases now that we have a proper technique for registering xprofile field types. Your birthdate-to-age converter is a great example of a field type that could be registered with just a couple lines of code. Your other examples are great ideas too, at least for specific kinds of sites.

However, building a general tool for this purpose is almost impossible. What would the UI look like? There are many different kinds of calculations/modifications that could be relevant:

  • date calculations
  • arithmetic calculations
  • distance calculations
  • specific kinds of URL concatenation (eg, a twitter handle -> twitter URL)
  • conversion into links

etc etc

If there are specific cases where a specific field type would be useful to large numbers of sites - such as a "URL" type that validates URLs and then converts them into links (useful for arguably any BP site) - let's open separate tickets for them. But building a general tool for creating these "calculated" fields in some sort of UI seems well beyond what BP can or should do. Tentatively closing as wontfix for that reason.

Note: See TracTickets for help on using tickets.