2

我已经安装了Joomla3.x 和一些模块。

我的模块之一是显示来自我的文章的某些类别的文章,但是当我导航到我的文章时,CSS样式表不会加载。

当我查看源代码时,我发现上面页面中 CSS 样式表的 URL 变为:

<base href="http://cambridge.mywebcommunity.org/index.php/10-%E7%88%B1%E7%AB%8B%E6%96%B9%E5%8A%A8%E5%90%91%E6%9B%B4%E6%96%B0/3-welcome-to-your-blog" />

...而不是我输入的原件,在这里:

<base href="http://cambridge.mywebcommunity.org/" />

这也发生在模块中的另一个 CSS 样式表上。CSS URL 加载如下:

 <link rel="stylesheet" href="http://cambridge.mywebcommunity.org/10-爱立方动向更新/modules/mod_news_pro_gk5/interface/css/style.css" type="text/css" />

...而不是我输入的原始 CSS URL:

  <link rel="stylesheet" href="http://cambridge.mywebcommunity.org/modules/mod_news_pro_gk5/interface/css/style.css" type="text/css" />

所以我发现问题是 Joomla 没有正确添加 URL。我将如何解决这个问题?

4

1 回答 1

1

From what you've posted it looks like you (or extension developers) are trying to add css with absolute links. Looking at the source of your page will quickly show you that your links look different from the core links in that they are absolute not relative. You may need to look a the code in the modules doing this and fix or contact the developers and ask them to fix. Also ask them about the js.

In Joomla you add style sheets with code like this in your template index:

$doc->addStyleSheet('templates/'.$this->template.'/css/template.css');

The change in behavior is most likely due to a recent security fix concerning uris in the header. I'm not going to link to details of the exploit but easy enough to find out why this was changed, but it was for good reasons.

于 2013-05-13T09:44:04.133 回答