prestashop 1.7css文件显示取决于url地址



我想创建一个机制,根据url地址显示css文件

示例如果url=www.domain.com/our.php,则我们打印<style> background: red; </style>,如果不是,则打印<style> background: blue; </ Style>

chciałbym to umieśćićmiÉdzy<head>

在PrestaShop中,您可以直接在模板文件中执行这些操作,您有许多辅助变量可用:https://devdocs.prestashop.com/1.7/modules/creation/displaying-content-in-front-office

搜索";这里是Smarty变量"的列表;

您可以在此处加载其他样式:/主题/your_theme/templates/_partials/head.tpl

你可以做例如:

{if $page.page_name == 'product'}
{literal}<style>body { background: red !important; }</style>{/literal}
{/if}

这将导致产品页面上出现红色背景。

最新更新