• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Fabrik and Plotalot with variables in Calc

sunnyjey

Active Member
I am trying to insert Plotalot variable in Calc, but somehow it is not working.

As per this thread:
http://fabrikar.com/forums/index.ph...talot-with-variables.44027/page-2#post-226001
@cheesegrits has suggested to use
Code:
FabrikHelperHTML::runContentPlugins($myString);

to run Plotalot code, eg

Code:
$year ='{listname___myelement_year}';
$myString = '{plotalot id="21" P1="' . $year . '"}';
FabrikHelperHTML::runContentPlugins($myString);
return $myString;

In another thread @cheesegrits has suggested to pass evalScripts() function to be run if the plotalot graph to be changed on the fly. Ref Thread: http://fabrikar.com/forums/index.php?threads/run-js-in-php-on-calc-plugin.45320/#post-233465

Code:
$response = "all the other visible stuff for the plotalot graph";
$response .= '<script type="text/javascript">evalScripts();</script>';
return $response;

Please help me to understand how to pass evalScripts() function in Calc with Plotalot variable. I have tried following, but didnt work.

Code:
$year ='{listname___myelement_year}';
$myString = '{plotalot id="21" P1="' . $year . '"}';
FabrikHelperHTML::runContentPlugins($myString);
$response = $myString ;
$response .= '<script type="text/javascript">evalScripts();</script>';
return $response;
 
Last edited:
Does
Code:
return '{plotalot id="21" P1="2020"}';
or
Code:
return JHTML::_('content.prepare', '{plotalot id="21" P1="2020"}');
work?

If so, then
Code:
$year ='{listname___myelement_year}';
return '{plotalot id="21" P1="' . $year . '"}';
or
Code:
$year ='{listname___myelement_year}';
return JHTML::_('content.prepare', '{plotalot id="21" P1="' . $year . '"}');
should work, too.
If not, what element type is listname___myelement_year? Perhaps you need to append _raw?
 
Thank you for reply. Please find my answers in bold letters.

Does this work ?
Code:
return '{plotalot id="21" P1="2020"}';
NO

Code:
return JHTML::_('content.prepare', '{plotalot id="21" P1="2020"}');
This works

Code:
$year ='{listname___myelement_year}';
return '{plotalot id="21" P1="' . $year . '"}';
Doesn't work

Code:
$year ='{listname___myelement_year}';
return JHTML::_('content.prepare', '{plotalot id="21" P1="' . $year . '"}');
Doesn't work

If not, what element type is listname___myelement_year? Perhaps you need to append _raw?

Tried with both normal field (2020) as well as dropdown field (2020) with both _raw and without raw values.

As per Hugh ( Ref: Thread), we need to pass plotalot evalScripts() function to the Calc:

I added it specifically for someone who was using the calc element to produce 'plotalot' graphs, which she wanted to update on the fly when altering dropdown selections. The problem was that although we could generate the plotalot plugin code from the calc, it also required the plotalot evalScripts() function to be run if the graph was changed on the fly.

I dont know how to pass evalscripts() to calc.
 
Yes.

I spent hours with different code combination, deleting cache, loading form through plugin / direct form load ... But still not able to figure it out.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top