I seem to be missing a variable

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Silvertiger
Regular
Posts: 6
Joined: Thu Nov 20, 2008 7:57 pm

I seem to be missing a variable

Post by Silvertiger »

I am adding a Javascript (google translation) to the page just below the header, but when I add it the page errors out. I do know why, but I don't know the fix.

in the Java it uses a bracket { } to enclose some fo the java code, but in the TPL it uses that to express a variable. how can I change the code to place the actual { instead of interpreting it as an open bracket for a TPL variable? I did see some other variables called {ldelmiter} and {rdelimiter}, but i presume those are quotes or soemthing... any ideas?

Any help would be apprecaited.

Thanks,

Silver
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: I seem to be missing a variable

Post by garvinhicking »

Hi!

The FAQ on www.s9y.org mentions to use {ldelim} for { and {rdelim} for } - your assumption's correct.

The other way is to enclose your javascript in a {literal} block.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Just as Garvin mentions, I personally find {literal} to be far easier.... ie

Code: Select all

{literal}
    <script>blah blah</script>
{/literal}
=Don=
Post Reply