saman0 / flexicontent

Automatically exported from code.google.com/p/flexicontent
0 stars 0 forks source link

Calculation Field #185

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What is the expected output? What do you see instead?
The Idea is a ResultFlexiField. This is a simple idea.

1- Create a Number Field Called Number of users
2- Create Another Number Field Called Number of Children
3- Create a ResultField and set it to MULTIPLY and we could select wich fileds 
to multiply:
    Number Field Called Number of users x Number Field Called Number of Children
4- The we could make some more advance calculation as everyone can imagine

Please provide any additional information below.
I would like to create a complex table with some calculation, but I want to the 
user never leave Flexicontent. 

What do you think?

Original issue reported on code.google.com by neverseen.pTuga on 18 Aug 2011 at 1:37

GoogleCodeExporter commented 9 years ago
A single custom field can do this stuff, a developer
1. could duplicate the textfield,
2. add some options to be displayed when the field is edited
3. The type of calculation could be set at 2 or at the field configuration of 
the field.

Original comment by ggp...@gmail.com on 18 Aug 2011 at 3:01

GoogleCodeExporter commented 9 years ago

Original comment by ggp...@gmail.com on 18 Aug 2011 at 6:07

GoogleCodeExporter commented 9 years ago
May I ask what WontFIX means? :D by the way, I am no developer thats way I 
asked for this feature hehe

Original comment by neverseen.pTuga on 18 Aug 2011 at 6:10

GoogleCodeExporter commented 9 years ago
Not sure about it's usefulness i will leave this open, maybe it can be useful, 
but not only for calculation but rather like a COMBINATION field, concatenation 
calculation etc, i will think of it

Original comment by ggp...@gmail.com on 18 Aug 2011 at 6:36

GoogleCodeExporter commented 9 years ago
I see. Of course, my idea is to add some "simple" intelligence to Flexi.
This is not priority but something like this would cool. 

Original comment by neverseen.pTuga on 18 Aug 2011 at 6:40

GoogleCodeExporter commented 9 years ago
Also you don't have to use the default template of Flexicontent.
Just put fields in some template position (not important in which position 
since at the template we WILL IGNORE the position), and then make a COMPLETELY 
CUSTOM items.php file to output your item data:

<div class='label'><?= $this->fields['myfield1']->label; ?></div>
<div class='value'><?= $this->fields['myfield1']->display; ?></div>

<div class='label'><?= $this->fields['myfield1']->label; ?></div>
<div class='value'><?= $this->fields['myfield2']->display; ?</div>

<div class='label'>Total</div>
<div class='value'><?php
$multiply_result = floatval($this->fields['myfield3']->display) * 
intval(this->fields['myfield4']->display);
echo $multiply_result;
?></div>

You don't need custom field to do this, you can do any calculation and display 
at the template !!!

Original comment by ggp...@gmail.com on 18 Aug 2011 at 8:45

GoogleCodeExporter commented 9 years ago
I see. Thanks i will give it a try :) maybe this is more then enouthg. Thanks

Original comment by neverseen.pTuga on 18 Aug 2011 at 11:37

GoogleCodeExporter commented 9 years ago
Also you don't have to scrap ALL positions completely, maybe use all positions 
except one e.g. call to the "subtitle2"  assign fields you will output 
customarily

then go to the file items.php, find this position "subtitle2"  remove it and 
use the above code ...

Original comment by ggp...@gmail.com on 18 Aug 2011 at 11:45