Magento : Add CMS javascript reference
Submitted by Kevin on Fri, 14/08/2009 - 10:44
- Kevin's blog
- 2802 reads
Fri, 21/08/2009 - 13:56
#2
So if I understand you
So if I understand you correctly from your magento CMS web page you want to get the URL of an image that's in your skin folder and then use this in your javascript?
well, you can reference the image url like this:
{{skin url='images/an_image.png'}}If your javascript is inline you can just include references like that and the full url will be inserted. If it's an external script you could pass the urls as arguments and again use this type of reference to set up the arguments...
Or you could include your images in some hidden DIVs and have your script pull them from there.
This might be of interest too:
http://www.magentocommerce.com/boards/viewthread/14895/
Hope this helps...
Thu, 07/01/2010 - 20:12
#3
Works and Doesn't Work
I can get the javascript to show up in the head. Great.
Now... I have a slideshow that is using inline vars underneath the html. How do I add that into the cms page.
Also... does magneto come with any javascript framework's pre-installed? just wondering.
I'm a little frustrated, I built a really nice jquery specials slider for the home page, now I can't even get it in there.
Anyhelp on the topic would be awesome.
Regard,
Fri, 08/01/2010 - 00:21
#4
Stranger
Hi, stranger here... my problem was with the javascript framework that already comes with magento. It was interfering with my Jquery code.
Mon, 15/02/2010 - 16:52
#5
This worked beautifully!
Thanks for this excellent post, Kevin. I couldn't figure out - for the life of me - how to include a script. Everyone made it sound so easy to di it through the CMS, but like you said, no one bothered to explain it properly (or correctly.)
Thanks to your post, I was able to get my script working on my CMS page with absolutely NO problems whatsoever.
Thanks again!
Wed, 17/02/2010 - 21:31
#6
Hey - Thanks for the nice
Hey - Thanks for the nice comment, I'm glad that you found the post useful!













hello this post is very nice. can you please tell me how can we get url of an image in cms page in magento in javascript. i am trying to add a slide show in my home page but just stuck on this problem. so plz help me and tell me how can i get image url that is in skin folder in magento