Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
485 views
in Technique[技术] by (71.8m points)

php - MODx - Resource Alias breaking plugin - Using pages with "/" in the URL? ( /resources/page.html )

I currenlty have a MODx website setup, and I am wondering if it's proper to have my links look like this (And by that I mean my resource alias):

myurl.com/help/configuration/basics.html

Putting the slash in the URL like that... is it a bad practice? My main problem is that this breadcrumb plugin seems to no longer work... :( I want to have this breadcrumb plugin operational again, if someone would mind helping me.

The Error:

When say using the breadcrumb to link to a page that's myurl.com/code/landing.html and the current page is myurl.com/help/configuration/basics.html, it will then redirect you to a link that doesnt exist, that looks like this:

myurl.com/help/configuration/code/landing.html

As you can see, it is appending the latter portion of the new page's url, but it is not properly removing the URL of the current page, as it only removes the current URL up to the '/' slash....

Does anyone know how to fix this? Possibly a way to make it so that instead of doing it's current "remove" and "append" thing, I can change breadcrumbs.class.php to take the value of the links as if I had clicked the link with the "view" button on the MODx manager? I'm not an expert at php, and it is a must for this to work. Or are there other alternatives to creating the " / " effect in my links, rather than just putting it in the resource alias? (As I want the site to follow a logical, readable, order)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

With all things modx, clear the cache, even if you don't think it could be the issue ~ modx is very aggressive about caching stuff.

Though this kinda sounds like maybe your base href tag may be set to <base href="" />, possibly in your templates it may look like:

<base href="[[++site_url]]"></base>

where site_url is set dynamically [it's not a system setting so don't look for it] in your /core/config/config.inc.php as $modx_base_url ... if that value is blank that could be causing the issue.

Also check your rewrite rules in your .htaccess to see what the rewrite base is. [it should be / ]

then refresh your cache... ;)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

Just Browsing Browsing

[3] html - How to create even cell spacing within a

1.4m articles

1.4m replys

5 comments

57.0k users

...