0

I'm creating a static block to show custom menus and calling this static block inside topmenu.phtml. Now I want to write some javascript code which will be applied on the ids/classes present in that static block. How I can link my static block to js file where I can write my js/jquery code? I've tried this way but it didn't work.

<script  src="<?php echo $this->getSkinUrl('js/jquery-1.4.4.min.js');?>"></script>
<script  src="<?php echo $this->getSkinUrl('js/myfile.js');?>"></script>
2
  • you want to include script in static block? Aug 1, 2015 at 14:20
  • Not sure I understand correctly, but do you mean you want to include JS files in a static block that's created in the admin panel of Magento?
    – Dan
    Aug 1, 2015 at 16:07

1 Answer 1

0

To get the skin URL in cms page/static block.

{{skin url="your-path"}}

So now you can add script like below.

<script src="{{skin url="your-path"}}"></script>

Or else you can directly add script with in script tag

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.