Hi people,
I’ve got intro trouble with DropMenu using SEO friendly alias paths (both enabled: aliases and alias paths).
Problem:
topic1
topic2/
topic2/sub
If I’m navigating into topic2, then because of DropMenu spitting out relative links, my navigation shows topic2/topic1 for the topic1, which is wrong, because topic1 is also a root topic.
I searched the forum and the problem is well known. There also exists a fix: Simply putting
<base href="[(site_url)]" /> into the document head. But I didn’t like this one, particularly as this triggers another side effect with "#" links.
I did some small fix (which is a hack and completely unsupported!) presented as a standard unified diff:
--- document.parser.class.inc-ORIG.php Wed Apr 26 21:26:02 2006
+++ document.parser.class.inc.php Thu Jul 13 23:44:06 2006
@@ -801,5 +801,5 @@
function makeFriendlyURL($pre,$suff,$alias) {
$dir = dirname($alias);
- return ($dir!='.' ? "$dir/":"").$pre.basename($alias).$suff;
+ return $pre.($dir!='.' ? "$dir/":"").basename($alias).$suff; // SEO friendly "alias path" FIX: we use the prefix as a base dir prefix
}
It simply puts the system configuration option "Prefix for friendly URLs" in front of the complete URL, so if I set this option to "/" (without the double quotes), it simply puts all URLs absolute to the site domain. As I already said, this is a hack - IMHO it would be best, if there exists another global option for this purpose.
I’d like to know from the experts if this has any side-effects, maybe with existing major plugins.
You’ve be warned: This is a (possibly bad) HACK - I’m IN NO WAY an expert with MODx!
Greetings,
Alex