Jump to content

How to use Jquery script in CMS?


Recommended Posts

Hi

 

I have a Jquery script that I would like to use in a CMS page. How can I do it? It doesn't seem to work if I use it directly. I've done the same on other carts but not able to do so in PS 1.6. Any help please?

 

TIA

Link to comment
Share on other sites

I need to add this to the code:

 

<link rel="stylesheet" type="text/css" href="css/dcsns_wall.css" media="all" /> but everytime I save and return to it, it goes missing from the editor and doesn't apply on the CMS page too.

 

What should I do?

Edited by peanut (see edit history)
Link to comment
Share on other sites

you have to upload these file somewhere to your hosting account (ftp)

then instead of href="css/dcsns_wall.css" use href with direct link to file like href="http://yourwebsite.com/css/dcsns_wall.css"

 

the other thing: paste contents of this file to your CMS contents between <style></style> html tag. effect will be the same, but the code just be attached as a code, not a file ;)

Link to comment
Share on other sites

you have to upload these file somewhere to your hosting account (ftp)

then instead of href="css/dcsns_wall.css" use href with direct link to file like href="http://yourwebsite.com/css/dcsns_wall.css"

 

the other thing: paste contents of this file to your CMS contents between <style></style> html tag. effect will be the same, but the code just be attached as a code, not a file ;)

tried it but doesn't work. The code is not there after I save the cms page. It's the only piece that isn't working.

Link to comment
Share on other sites

  • 3 weeks later...

To improve this answer from dioniz you can add
{if isset($page_name) && $page_name == "cms"}
   css link

{/if}

 

And remember, you have body classes (for cms page its cms-{page_id} and cms-{page_alias}) use them in your css code to override global selectors.

  • Like 1
Link to comment
Share on other sites

Try to add css link to header.tpl just after {if isset($css_files)}

 

 

To improve this answer from dioniz you can add

{if isset($page_name) && $page_name == "cms"}

   css link

{/if}

 

And remember, you have body classes (for cms page its cms-{page_id} and cms-{page_alias}) use them in your css code to override global selectors.

 

I've tried it but still hasn't worked. I don't know what I'm doing wrong. I only want this one cms page to use that particular css in the content.

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Hi guys,

 

I can't seem to get it to work in v1.6. Have changed the Validate.php as per Vekia's article here, I only end up with an empty <p></p> tag after saving the page...

 

Any help or ideas are very appreciated!

 

 

Cheers

Clemens

 

what version exactly? 1.6.0.8? if so - check html purifier feature available under preferences > general

if it's enabled - disable it

 

this feature crashes a lot of useful html/js/css snippets

  • Like 1
Link to comment
Share on other sites

what version exactly? 1.6.0.8? if so - check html purifier feature available under preferences > general

if it's enabled - disable it

 

this feature crashes a lot of useful html/js/css snippets

Thanks Vekia, that did the trick!

 

Cheers

Clemens

Link to comment
Share on other sites

×
×
  • Create New...