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

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.
Locked
basicus

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

Post 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?
cyberman

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

Post by cyberman »

basicus wrote: but it won't accept it.
Have you tried to use javascript in udt without literal tags ?
basicus

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

Post 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.
Last edited by basicus on Sun Jan 28, 2007 6:30 pm, edited 1 time in total.
cyberman

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

Post by cyberman »

Can you post source?
basicus

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

Post 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
basicus

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

Post 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.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

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

Post by Dr.CSS »

When you put it in do you check, in source view, to make sure it's not getting formatted?... or ....
basicus

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

Post 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. 
cyberman

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

Post 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.
basicus

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

Post 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 :)
Locked

Return to “CMSMS Core”