Jump to content
  • 0

Add Javascript To The Cms Break The Page


activa

Question

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 .

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

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. 
Link to comment
Share on other sites

  • 0

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 .

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0

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 .

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...