Page 1 of 1

How to get the {literal}-tag to work?

Posted: Sun Jan 28, 2007 3:48 pm
by basicus
I'm using CMSMS version 1.0.2 on a Linux server.

I have trouble getting the {literal}{/literal} tag to get accepted when I use it to make a user-defined tag (UDT). I am trying to make a UDT with Javascript in it, but it seems I can't get CMSMS to accept the literal-tag at all.

I have tried to save the UDT-tag even with only {literal}{/literal}, but it won't accept it.

The error code I get is:
Parse error: syntax error, unexpected '}' in /home/cms/admin/adduserplugin.php(84) : eval()'d code on line 1

Any ideas what I am doing wrong?

Re: How to get the {literal}-tag to work?

Posted: Sun Jan 28, 2007 5:16 pm
by cyberman
basicus wrote: but it won't accept it.
Have you tried to use javascript in udt without literal tags ?

Re: How to get the {literal}-tag to work?

Posted: Sun Jan 28, 2007 6:28 pm
by basicus
Yup. I have tried all combinaltions I could come up with, including without the literal tag. It just wont accept any of them.

That was also the reason I tried using {literal}{/literal} alone without any Javascript. It does not accept the tag at all. In the error message it looks to me like it has problems with the first }.

It's really weird that it does not accept it.

The site I'm working on is a new installation, and I had no errors when installing it. That indicates that everything has been installed correctly.

Re: How to get the {literal}-tag to work?

Posted: Sun Jan 28, 2007 6:46 pm
by cyberman
Can you post source?

Re: How to get the {literal}-tag to work?

Posted: Sun Jan 28, 2007 7:03 pm
by basicus
Sure. I guess you mean the source for the Javascript?




  var googleSearchIframeName = "results_0000XXXXXX";
  var googleSearchFormName = "searchbox_0000XXXXXXXX";
  var googleSearchFrameWidth = 600;
  var googleSearchFrameborder = 0;
  var googleSearchDomain = "www.google.com";
  var googleSearchPath = "/cse";




I have removed the site specific code, and replaced them with XXXXX

Re: How to get the {literal}-tag to work?

Posted: Sun Jan 28, 2007 7:05 pm
by basicus
The thing is I find most strange about this, is that it fails even without any Javascript. Just with {literal}{/literal} tags and nothing else.

Re: How to get the {literal}-tag to work?

Posted: Mon Jan 29, 2007 3:45 am
by Dr.CSS
When you put it in do you check, in source view, to make sure it's not getting formatted?... or ....

Re: How to get the {literal}-tag to work?

Posted: Mon Jan 29, 2007 4:29 am
by basicus
Hm. Not sure what you mean by that mark. In adduserplugin.php I can't see the content of the area where I write the tag. However, I have turned off the wysiwig editor to prevent what you mention from happening.

Since I can't get it to accept the tag, I can't check it in the front eighter I suppose. 

Re: How to get the {literal}-tag to work?

Posted: Mon Jan 29, 2007 4:45 am
by cyberman
basicus wrote: is that it fails even without any Javascript. Just with {literal}{/literal} tags and nothing else.
Upps, the answer is too simple ... it's not a bug, it's a feature  8).

In userdefined tags you are in "php only" modus. Smarty will NOT parse udt. You can include javascript like you know from php like this

Code: Select all

?>
<!-- Google Search Result Snippet Begins -->
<div id="results_0000XXXXXXX"></div>
<__script__ type="text/javascript">
  var googleSearchIframeName = "results_0000XXXXXX";
  var googleSearchFormName = "searchbox_0000XXXXXXXX";
  var googleSearchFrameWidth = 600;
  var googleSearchFrameborder = 0;
  var googleSearchDomain = "www.google.com";
  var googleSearchPath = "/cse";
</__script>
<__script__ type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></__script>
<!-- Google Search Result Snippet Ends -->
<?php
or via echo command.

Re: How to get the {literal}-tag to work?

Posted: Mon Jan 29, 2007 5:04 am
by basicus
Ah. I see. The first suggestion you have in your code-box here does not work. But, echo does.

Thanks a lot for the help guys :)