Hello,
I'm having a problem installing JavaScipt to webpages using CMSMS. The script doesn't work and I think it is because CMSMS interprets {} signs in this code wrongly (its working fine outside CMSMS, although directory paths are bit different):
Shadowbox.loadSkin('classic', 'uploads/js/src/skin');
Shadowbox.loadLanguage('en', 'uploads/js/src/lang');
Shadowbox.loadPlayer(['flv', 'html', 'iframe', 'img', 'qt', 'swf', 'wmp'], 'uploads/js/src/player');
window.onload = function(){
Shadowbox.init();
};
How can I get this working? Are [] signs in the code ok?
Thanks already.
[solved] How to deal with {} sign that are not meant to be CMSMS tags
-
- Forum Members
- Posts: 20
- Joined: Tue Nov 11, 2008 11:25 pm
[solved] How to deal with {} sign that are not meant to be CMSMS tags
Last edited by Apprentice on Fri Dec 19, 2008 4:55 am, edited 1 time in total.
Re: How to deal with {} sign that are not meant to be CMSMS tags
the Smarty get confused if you include {} in the content!
This is fundamental Smarty knowledge:
Suround your scripts that include {} with literal tags like this: {literal} {your code} {/literal}
This is fundamental Smarty knowledge:
Suround your scripts that include {} with literal tags like this: {literal} {your code} {/literal}
ReneH 
A search will save you hours waiting for an answer!

A search will save you hours waiting for an answer!

-
- Forum Members
- Posts: 10
- Joined: Tue Dec 02, 2008 8:04 pm
Re: How to deal with {} sign that are not meant to be CMSMS tags
From the Smarty docs page:
Ben
Regards,Escaping Smarty Parsing
It is sometimes desirable or even necessary to have Smarty ignore sections it would otherwise parse. A classic example is embedding Javascript or CSS code in a template. The problem arises as those languages use the { and } characters which are also the default delimiters for Smarty.
The simplest thing is to avoid the situation altogether by separating your Javascript and CSS code into their own files and then using standard HTML methods to access them.
Including literal content is possible using {literal}..{/literal} blocks. Similar to HTML entity usage, you can use {ldelim},{rdelim} or {$smarty.ldelim} to display the current delimiters.
It is often convenient to simply change Smarty's $left_delimiter and $right_delimiter.
Ben

Re: [solved] How to deal with {} sign that are not meant to be CMSMS tags
Exellent, this was exactly what I was looking for!
Should have thought of the {literal} tags.

Should have thought of the {literal} tags.