ModXのWayfinderはナビゲーションリストを作るときに、base_urlからの相対パスを出力する。 よってテンプレートに<base>tagで [[++site_url]]指定をしてやる必要がある、これを指定せずに階層の下がったページからナビゲーションしようとすると システムはカレントパスを相対パスの前に追加するからリンク先が存在しない事態になる。
Make sure you have the following in the the <head> section of your template:
Code:
<base href=”[(site_url)]” />
without the above code in the site template, the navigation menu wayfinder will generate will not render correct path. This is because Wayfinder generates the path from base url. If you left <base> tag out, the system will always start from current path.
Let me describe what had happened to me.
Target document tree looks like below;
one – two
|_ three
|__ four
|__ five
The wayfinder sinppet generates a list with correct hrefs and works fine in the page one.
When navigated to page two, then the links generated for other pages are incorrect.
if you are in second level, then the path will start as http://…/one. the wayfinder adds /one/three. Therefore the generated path is http://…../one/one/three, rather than http://…./one/three etc., (“one/ “is repeated twice)
Simply adding the <base href=”[[++site_url]]”> line at the <head> section of the template solve the issue.