Can someone help me. Im new to all this modx stuff and i really like using it. only thng is now to i include javascript or php into my pages. If i try a php include it doesnt work and if i just paste all the java into the html it still fails to work. Do i need to use snippets or something ?
Much help on this please !!!
Where are you inserting the code?
If you’re pasting it into the ’content’ field of a resource then it might be getting stripped out by the rich text editor...
im clicking on the HTML button to go into HTML mode then inserting it then clicking update... when i go back to view it then it shows up like that !
-
☆ A M B ☆
- 3,112 Posts
Quote from: DavidMcArthur at May 04, 2011, 10:14 AM
thanks i will have a look 
Just one note though the java now shows like this
<script type="text/javascript">// <![CDATA[
mce:0
// ]]></script>
where has my code gone !! ? :p
"Java to javascript is like a car to a carpet."
They are definitely different.
Don’t put javascript into the resource’s content area.
They are could be changed by TinyMCE or modx’s sanitizer.
Some snippets do that before processing the value of the content, for security reason.
Quote from: lucas at May 04, 2011, 11:13 AM
However the better place for scripts (both linked and inline) is in a template or chunk instead, as you would your css and any other external scripts. Again, spend 30 minutes or so reading one of the tutes and you’ll save yourself a lot of time later 
+1
Rico
Genius is one percent inspiration and ninety-nine percent perspiration.
Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!
www.virtudraft.com
Security, security, security! |
Indonesian MODx Forum |
MODx Revo's cheatsheets |
MODx Evo's cheatsheets
Author of
Easy 2 Gallery 1.4.x,
PHPTidy,
spieFeed,
FileDownload R,
Upload To Users CMP,
Inherit Template TV,
LexRating,
ExerPlan,
Lingua,
virtuNewsletter,
Grid Class Key,
SmartTag,
prevNext
Maintainter/contributor of
Babel
Because it's hard to follow all topics on the forum, PING ME ON TWITTER
@_goldsky if you need my help.
Ok so your saying that a javascript file can be placed into a snippet ? how would i include the snippet into the page ? have you got a link to this tutorial so i can read it please thanks
or if i simply upload the .js file how to i include it in my page ?
-
☆ A M B ☆
- 3,112 Posts
Quote from: DavidMcArthur at May 05, 2011, 10:05 AM
or if i simply upload the .js file how to i include it in my page ?
That is the simplest one, although you can do this also:
Quote from: DavidMcArthur at May 05, 2011, 10:02 AM
Ok so your saying that a javascript file can be placed into a snippet ? how would i include the snippet into the page ? have you got a link to this tutorial so i can read it please thanks
This site can help you to learn modx smoothly
http://codingpad.maryspad.com/2010/08/18/modx-revolution-for-beginners-part-1-introduction/
Rico
Genius is one percent inspiration and ninety-nine percent perspiration.
Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!
www.virtudraft.com
Security, security, security! |
Indonesian MODx Forum |
MODx Revo's cheatsheets |
MODx Evo's cheatsheets
Author of
Easy 2 Gallery 1.4.x,
PHPTidy,
spieFeed,
FileDownload R,
Upload To Users CMP,
Inherit Template TV,
LexRating,
ExerPlan,
Lingua,
virtuNewsletter,
Grid Class Key,
SmartTag,
prevNext
Maintainter/contributor of
Babel
Because it's hard to follow all topics on the forum, PING ME ON TWITTER
@_goldsky if you need my help.