javascript in tags

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.
Post Reply
manurevah
Forum Members
Forum Members
Posts: 37
Joined: Fri Aug 03, 2007 2:24 pm

javascript in tags

Post by manurevah »

hello,

I've been looking at a few ways to insert a google map (using the API) in cmsms, i have found 2 solutions, one being a iframe, the other being a template that includes the javascript part + a page containing the div, then i read this http://wiki.cmsmadesimple.org/index.php ... fined_Tags

it seems i should be able to insert javascript in there (and then do other cool things) however i'm not sure how, for if i insert something like



i get this error

* Le code entré est invalide.  ('the code entered is not valid)
* Parse error: parse error, unexpected '<' in /var/snip.....snip/adduserplugin.php(94) : eval()'d code on line 1

i am using debian stable/etch and i'm using apache (1 and not 2) with php4 and mysql4 (the ones included with stable release of debian)

any help is welcome, if i can avoid making a template for every map i need that would be nice

thanks.

manu
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: javascript in tags

Post by tsw »

User defined tags are checked for php validity (evalled)

you can use

echo "<__script__ ......";

and so on

or try the GoogleMaps module
manurevah
Forum Members
Forum Members
Posts: 37
Joined: Fri Aug 03, 2007 2:24 pm

Re: javascript in tags

Post by manurevah »

thanks for your quick response.

i'm no php (nor javascript) pro, however i figured adduserplugin.php didn't like the syntax. . : [

i tried the 'echo' technique, it seems this may do the trick, i just have to put about $alot of backslashes. .. : ]

as for the googlemap plugin, it seems they have not yet released any files yet: http://dev.cmsmadesimple.org/projects/gmapmod
if you where referring to another plugin i'd be glad if you could share a link. . .
: ]


manu
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: javascript in tags

Post by RonnyK »

http://dev.cmsmadesimple.org/projects/googlemaps/

Ronny

P.S. you can type "Google" in the search (right-top of the dev-area), to see all modules containing the word "google"
Last edited by RonnyK on Fri Aug 03, 2007 7:47 pm, edited 1 time in total.
manurevah
Forum Members
Forum Members
Posts: 37
Joined: Fri Aug 03, 2007 2:24 pm

Re: javascript in tags

Post by manurevah »

thank you for that link.. . ...    downside is the plugin doesn't seem to quite work, i've checked alot of things like the KEYetc, i think i'll just leave it aside and get back to it after the weekend.. . ..
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: javascript in tags

Post by tsw »

you can also use

echo <<< THEEND
anything here ' " and so on

THEEND

(of course you can choose the delimeters ;)
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: javascript in tags

Post by RonnyK »

I've got GoogleMaps working on an environment.

http://www.ruimzicht.eu/index.php?page=test

Ronny
manurevah
Forum Members
Forum Members
Posts: 37
Joined: Fri Aug 03, 2007 2:24 pm

Re: javascript in tags

Post by manurevah »

thank you tsw. ... .however that still doesn't work in the user tags section of my cms made simple (btw, 1.1 samoa).. .

even with just:

Code: Select all

echo <<< END
bla bla
html
$variable_php
reblabla

END; 
i still get the same error.  the idea was to learn to make a user tag, then insert variables (such as the markers file). . ... 
Post Reply

Return to “CMSMS Core”