Subject: set_var is killing me!

Posted on: 01/04/11 03:30pm
By: Anonymous

I am using plugin_templatesetvars_menu to set a variable. I place some javascript in $menuhead then $template->set_var ('menuhead', $menuhead).

I know $menuhead has the full javascript. But once I place {menuhead} in the heading, the ending is chopped off. Oddly, I can place random characters on the ending and they appear. But the term 'this.ClassName=""' will not enter into {menuhead}.

Any thoughts - anyone?

Re: set_var is killing me!

Posted on: 03/04/11 06:38pm
By: Roccivic

Can you please post all the relevant snippets of code, including the all JS in question (and how it is generated), and the steps to reproduce the problem? Also please include the names of all the files that you are editing.


Re: set_var is killing me!

Posted on: 04/04/11 02:20pm
By: jmucchiello

My suggestion is to put most of your javascript and include as a separate file. Then just have a small javascript section to set whatever variables you need. In other words, avoid putting js functions through the template engine. Also, look into changes for Geeklog 1.8 for a class for adding javascript to a page.

PHP Formatted Code
 <link ...>
<script> var myvar = '{value}'</script>

Geeklog - Forum