css - joomla 3-别名使无法连接CSS

标签 css joomla joomla3.0 joomla3.1

当我在页面之间移动时,有些页面根本没有CSS。事实证明,页面的别名(例如“ sem03”)已添加到css链接标记的开头。

在FireBug中删除链接的前缀后,它可以正常工作。

我的问题是:如何从CMS本身页面的任何组件的链接标签中删除此前缀?管理系统中可以解决此问题的措施是什么?

例如 :

真正的标签应为:

<link type="text/css" href="/templates/protostar/css/template.css" rel="stylesheet">


不是这样的:

<link type="text/css" href="/08-sem03/templates/protostar/css/template.css" rel="stylesheet">

最佳答案

您在模板index.php(www / yourjoomlafolder / templates / index.php)中的标签应看起来像这样,以避免出现这种情况...

$doc = JFactory::getDocument();
$doc->addStyleSheet('templates/'.$this->template.'/css/template.css');


要么

<link type="text/css" href="<?= $this->baseurl ?>/templates/<?= $this->template ?>/css/template.css" rel="stylesheet">


了解<?= $variable ?>等同于<?php echo $variable; ?><?php print($variable) ?>。只是想为任何不使用或不了解PHP速记的人清除这些错误。

关于css - joomla 3-别名使无法连接CSS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17236778/

相关文章:

media-queries - 如何在 firefox 中为 img 设置响应高度(safari,chrome 工作)

javascript - Simple Image Gallery Pro 提交表单未定义

joomla - Joomla 3 中的管理员覆盖

html - 自定义css文件显示图标

css - chrome 缓存 bootstrap css 吗?

css - 免费的 CSS UI 模板

joomla - 如何在 joomla 中创建自己的表单

jquery - 我想知道是否可以给 nth-child 一个类属性

javascript - 如何将带有 Javascript 的类添加到特定 div 内自动生成的 Joomla 菜单子(monad)项 'li' 中?

php - 为 Joomla3 组件创建虚拟内容