Hello everybody,
I would like to insert a Google Analytics instruction on my pages.
http://www.philibert.ch
I thought that could be easier to create a user tag instead of typing the whole code in every page...
The instruction I received from Google Analytics is
echo '';
...
The problem is that the 3rd line is cutted in the CMSMS editor (like here) and is understood as a new line. Then I got the error message
# Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/www/ea1e6a33c37a3beb702c4802b7843447/web/cmsms/admin/adduserplugin.php(94) : eval()'d code on line 3
My question: How could I tell CMSMS that instruction on line 3 continue on line 4?
Thank you in advance,
Philippe Roth
Javascript and long instruction
Re: Javascript and long instruction
that's what global content blocks are for..Philibert wrote: I thought that could be easier to create a user tag instead of typing the whole code in every page...
make one with the html and/or smarty code you want to include...
add a call to it in your page template...
{global_content name='nameofyourgcbhere'}
then you're done.
OR, you can just put the code directly in your template.. but using a global content block allows easier use on multiple templates and having to edit it only once if it changes.
using a udt instead just adds a little extra work as you have to php-ify the html code google gave ya.
note.. if you did a copy/paste of that code you included in your post, double-check your single & double quotes..
eternity (n); 1. infinite time, 2. a seemingly long or endless time, 3. the length of time it takes a frozen pizza to cook when you're starving.
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
4,930,000,000 (n); 1. a very large number, 2. the approximate world population in 1986 when Microsoft Corp issued its IPO. 3. Microsoft's net profit (USD) for the quarter (3 months) ending 31 March 2007.
CMSMS migration and setup services | Hosting with CMSMS installed and ready to go | PM me for Info
Re: Javascript and long instruction
Insert this before your ending tag
Code: Select all
{literal}
<__script__ type="text/javascript"><!--
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
//--></__script>';
{/literal}
Re: Javascript and long instruction
Hello Kermit,
Thank you very much for the light
It works wonderfully
You helped me to better understand CMSMS.
Have a nice week-end,
Phil
PS: I use CMSMS since a while, but I find it marvelous! It's community too
Great job!
Thank you very much for the light

It works wonderfully

You helped me to better understand CMSMS.
Have a nice week-end,
Phil
PS: I use CMSMS since a while, but I find it marvelous! It's community too
