user defined tag and {literal} {/literal} help

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
jdwork
Forum Members
Forum Members
Posts: 10
Joined: Sat Dec 23, 2006 7:03 pm

user defined tag and {literal} {/literal} help

Post by jdwork »

I have a javascript calendar that I wanted to put into a user defined tag.

I pasted the script between {literal} {/literal} tags into a proper web page and it works fine.

When I paste the code into a user defined tag I get a syntax error on the curly brace } line 1.

I tried the documentation sample:

Code: Select all

  {literal}
  <__script__ language="JavaScript" type="text/javascript">
  // code here
  </__script>

  <style type="text/css">
  /* css here */
  </style>
  {/literal}
and I get the same error:
# Parse error: syntax error, unexpected '}' in /home/www/cmsmadesimple/admin/adduserplugin.php(100) : eval()'d code on line 1

Any ideas?
Thanks in advance!
viebig

Re: user defined tag and {literal} {/literal} help

Post by viebig »

UDT´s are PHP Code
Global Contents Blocks are smarty

if you want that on a UDT you should use

Code: Select all

echo '
 <__script__ language="JavaScript" type="text/javascript">
  // code here
  </__script>

  <style type="text/css">
  /* css here */
  </style>
';
Dont forget to escape chars!

then call it by {udtname}

If you use GCB´s

Code: Select all

 {literal}
  <__script__ language="JavaScript" type="text/javascript">
  // code here
  </__script>

  <style type="text/css">
  /* css here */
  </style>
  {/literal}
and call it by using {global_content name="gcbname"}

Hope that helps!
Post Reply

Return to “CMSMS Core”