Welcome to Geeklog Saturday, August 15 2020 @ 02:52 pm EDT

Geeklog Forums

set_var is killing me!


Dmite

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?
 Quote

Status: offline

Roccivic

Forum User
Moderator
Registered: 19/05/10
Posts: 136
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.

Rouslan
 Quote

Status: offline

jmucchiello

Forum User
Full Member
Registered: 29/08/05
Posts: 985
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>
 
 Quote

All times are EDT. The time is now 02:52 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content