activa Posted September 4, 2015 Report Share Posted September 4, 2015 i want to add a simple javascript in the cms page . but i get a error unexpected character in filters : "(" at 8804 on line 233 in /home/ccccccc/public_html/blesta/vendors/h2o/h2o/parser.php how i can post javascript to the cms page ? <script type="text/javascript"> $(document).ready(function() { get_data(); }); function get_data() { $(this).blestaRequest("GET", "/blesta/plugin/data/get_data/", null, function(data) { if (data) $(".replaceer_box").html(data); }, null, {dataType:"json"}); } </script> the error not in the admin side . error in client page view . Quote Link to comment Share on other sites More sharing options...
0 Michael Posted September 4, 2015 Report Share Posted September 4, 2015 You should put it in the structure.pdt Quote Link to comment Share on other sites More sharing options...
0 Tyson Posted September 4, 2015 Report Share Posted September 4, 2015 Someone asked me about this the other day. Here is my response: The Portal plugin is not intended to support JavaScript from its input in the UI. JavaScript conflicts with the H2o parser for tag replacement because it contains braces (i.e. { and }). If you would like to set that JavaScript to the portal, it would be better to set it in the template that displays the portal instead. You can find that template at /plugins/cms/views/default/main.pdt. Since it's a core change, you should probably make a note of the fact a core file has been changed. You can use vQmod to perform 'virtual' changes to the core without making real core file modifications. However, if the file gets updated in the future such that your custom vQmod change no longer applies, you would need to re-add your custom change with a new vQmod addition. Michael 1 Quote Link to comment Share on other sites More sharing options...
0 Blesta Addons Posted September 5, 2015 Report Share Posted September 5, 2015 OR put your code in a js file , and the call it by <script src="blesta/path_to_your_js_file/file.js"></script> that way i use it and it work like a charm . NOTE : is a pain that CMS plugin is limited by a third party helper . Quote Link to comment Share on other sites More sharing options...
0 Michael Posted September 5, 2015 Report Share Posted September 5, 2015 NOTE : is a pain that CMS plugin is limited by a third party helper . Why? the whole blesta uses h2o, why stop on one plugin because you don't want to be limited because of h2o? why not ask them to make a js tag? Quote Link to comment Share on other sites More sharing options...
0 Blesta Addons Posted September 5, 2015 Report Share Posted September 5, 2015 the whole blesta uses h2o. That is not true . why stop on one plugin because you don't want to be limited because of h2o? i wil not stop , i just ask and give my opinion . why not ask them to make a js tag? if i will use it in my script i wil ask them . here blesta who shoud ask them . Quote Link to comment Share on other sites More sharing options...
0 Michael Posted September 5, 2015 Report Share Posted September 5, 2015 That is not true . It is true though from the portal to emails to even plugins they all use h2o, {% if ….. %} {% /if %} etc is all the h2o.. Quote Link to comment Share on other sites More sharing options...
0 Blesta Addons Posted September 5, 2015 Report Share Posted September 5, 2015 It is true though from the portal to emails to even plugins they all use h2o, {% if ….. %} {% /if %} etc is all the h2o.. i let tyson reply here Quote Link to comment Share on other sites More sharing options...
0 Tyson Posted September 5, 2015 Report Share Posted September 5, 2015 H2o is used in locations where tag replacement can occur, but obviously this does not occur for every input field. Another possible work-around to the JS problem is to update the parser options Blesta defines for H2o in the config by changing the expected syntax characters (i.e. { and }) to something else, and subsequently updating each place that tag is used (e.g. email templates, portal, etc.) in Blesta. Blesta Addons 1 Quote Link to comment Share on other sites More sharing options...
0 Blesta Addons Posted September 6, 2015 Report Share Posted September 6, 2015 Another possible work-around to the JS problem is to update the parser options Blesta defines for H2o in the config by changing the expected syntax characters (i.e. { and }) to something else, and subsequently updating each place that tag is used (e.g. email templates, portal, etc.) in Blesta. Sound very good option . Quote Link to comment Share on other sites More sharing options...
Question
activa
i want to add a simple javascript in the cms page . but i get a error
how i can post javascript to the cms page ?
the error not in the admin side . error in client page view .
Link to comment
Share on other sites
9 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.