#1 2019-04-12 13:21:55
- capsmolet
- Member
- Registered: 2019-04-12
- Posts: 11
Formatted field
Hello all!
I have a field with the type "sungle list" can I count the number of elements of this field in a specific record and transfer the total to another field?
And one more question.
In the Gcbooks.gcm collection model, which means the following line:
<item type = "formatted" name = "fullrating" value = "% rating% / 10" style = "box" nomargin = "true" />
What does it mean and how is it used?
Thank.
Offline
#2 2019-04-12 18:37:35
Re: Formatted field
Second question first : some field can be computed and formatted from the values of other field. The "fullrating" field is used in the Read Only layout to display the rating out of ten instead of displaying stars. The syntax uses %name_of_field% to get the value and can apply a format to it (see for example our the title of comics is computed)
First question now : it could be possible to add some functions for these formatted fields than could be computed from statistics on collection. Currently this type of information is only available on the main screen (for exemple after a search or filter) or through the statistics menu.
For the specific case of "single list", another option could be to modify the widget that display the list as multiple rows so that the number of item is displayed along with the field name.
Offline
#3 2019-04-12 20:49:03
- capsmolet
- Member
- Registered: 2019-04-12
- Posts: 11
Re: Formatted field
Thank you very much for your answers and promptness.
Offline
#4 2019-04-12 20:56:12
- capsmolet
- Member
- Registered: 2019-04-12
- Posts: 11
Re: Formatted field
kerenoc wrote:
For the specific case of "single list", another option could be to modify the widget that display the list as multiple rows so that the number of item is displayed along with the field name.
How should it look like in practice?
Offline
#6 2019-04-15 09:20:45
- capsmolet
- Member
- Registered: 2019-04-12
- Posts: 11
Re: Formatted field
kerenoc wrote:
The number of items in a list could appear when the list is expanded (see attached mockup of the app). The availability of statistics from this part of the UI has to be checked in GCstar source code.
Ok, I get it, thanks!
Offline
#7 2019-04-15 14:58:48
- capsmolet
- Member
- Registered: 2019-04-12
- Posts: 11
Re: Formatted field
kerenoc wrote:
The availability of statistics from this part of the UI has to be checked in GCstar source code.
Thanks again for the consultation. What module is in, what did you say about?
Offline
#8 2019-04-17 10:30:40
Re: Formatted field
The small change to display the number of items when a list is expanded is implemented in the Test branch of my Gitlab repository. The modified file is GCPanel.pm.
Caveat : the number is updated only when the list is expanded, not when items are manually added to the list.
It couldn't think of a good and simple way to implement if for complex lists like the languages list for movies that has 2 columns, one for audio tracks and one for subtitles. Tell me if your use cases involves such lists.
Hope this helps.
Last edited by kerenoc (2019-04-17 10:32:26)
Offline
#9 2019-04-17 14:53:31
- capsmolet
- Member
- Registered: 2019-04-12
- Posts: 11
Re: Formatted field
Wow, thank you very much, I already have enough of what you suggested.
Offline
Should you have a problem using GCstar, you can open a bug report or request some support on GCstar forums.