2

I am using the latest ModX Revolution CMS which has both a dynamically created menu and content.

I have my menu set up as such:

<a href="#aboutus">About Us</a>

And, in my content:

<a name="aboutus" id="aboutus"><h1>About us</h1></a>

But upon clicking the links I just get 404s.

Is there a problem with this being dynamically created content?

(PS: FURLs are active)

EDIT: Not a proper answer but got it working by using:

  var pathname = window.location.pathname;

To add the current pages url to my anchor links.

Would still like to know the proper way of doing this

4

3 回答 3

1

要以正确的 modx 方式将当前页面 url 添加到您的锚点,您的链接应该是这样的:

<a href="[[*alias]]#aboutus">

如果 FURL 未激活,您可以在链接中添加“.html”:

<a href="[[*alias]].html#aboutus">

希望这可以帮助...

于 2013-12-03T11:40:17.603 回答
0

它对我不起作用的原因是我没有使用 FURL,所以我的 URL 看起来像:

mysite.com/index.html?id=2

是 PHP 变量未包含在 url 中,因此引发了 404。

我通过使用 JQuery 将整个路径名添加到我的链接中对此进行了修改:

var fullurl = window.location.href
于 2013-12-03T23:09:55.503 回答
0

检查您的基本 url 元标记,查看您使用的是 [[++site_url]] 还是 [[++base_url]],然后检查它们在系统设置中是否正确。

于 2013-09-06T16:22:17.533 回答