[英]How to apply custom CSS and Javascript specific CMS page Magento
我想在一個特定的CMS頁面上添加用於播放視頻的lightbox
。 我將CSS文件放在JS/MY THEME/JQUERY/PLUGIN/VENOBOX/CSS/myfile.css
並將JS文件放在JS/MY THEME/jquery/plugins/venobox/js/myfile.js
,但是沒有用。 我正在做所有事情,但沒有工作。
我在CMS頁面的布局更新XML中使用以下代碼:
<reference name="head">
<action method="addItem">
<type>js_css</type>
<name>smartwave/jquery/plugins/venobox/css/html5boxplayer.css</name>
</action>
<action method="addJs">
<script>
smartwave/jquery/plugins/venobox/js/html5lightbox.js
</script>
</action>
<action method="addJs">
<script>
smartwave/jquery/plugins/venobox/js/jquery.js
</script>
</action>
</reference>
如果有人實現了此功能,請提供幫助。 提前致謝。
對於CSS,您需要將文件包含在xml文件中,如下所示:
<action method="addItem">
<type>skin_css</type>
<name>css/html5boxplayer.css</name>
</action>
對於js,您需要執行以下相同操作:
<action method="addItem">
<type>skin_js</type>
<name>js/html5lightbox.js</name>
</action>
注意類型聲明。 當然,所有文件都應放在主題下的特定文件夾中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.