-
- 131 Posts
We've got a site with multiple English contexts and multiple language contexts running with Babel. It works ok except:
Whenever a page is within a container, and you navigate to another page, the new page's URL gets added to the existing one, creating a URL which doesn't exist e.g.
www.example.com/events is a page within a container
Navigate from this page to news.html and you get www.example.com/events/news.html when it should be www.example.com/news.html. If you remove the container status, the page becomes www.example.com/events.html and navigation works ok. This is a pain, because all articles posts have a screwed up navigation.
Wayfinder is discounted as the issue as we hard coded the navigation to check. Furls are enabled.
An additional issue is that if we leave articles as a container, it won't recognise the rowTpl chunk for the container page.
Bizarre. Can anyone help?
-
- 1,145 Posts
So you are using the Articles Extra?
TinymceWrapper: Complete back/frontend content solution.
Harden your MODX site by
passwording your three main folders:
core, manager, connectors and renaming your
assets (thank me later!)
5 ways to sniff / hack your own sites; even with renamed/hidden folders, burst them all up, to see how secure you are not.
-
- 179 Posts
I'm a bit confused by your description, to be honest. Can you confirm that events.htm is *in* a container, as opposed to being set as a container itself?
Also, check the URL on that menu link in the generated HTML. Does it include the full incorrect URL, or just the end part (news.htm) that you want? And thus, is it modx generating the incorrect URL, or is the URL being altered by the browser, perhaps as a result of <base href="..."> or similar?
-
- 131 Posts
Dave, sorry, I may have confused myself.
www.example.com/events IS the container, it has no ."html". The link to the page is www.example.com/events. But clicking on any link after that, even if it is not a child of the container still keeps the events/
So, say a page aboutus.html is at www.example.com/aboutus.htm and top level, not in a container, if you are on www.example.com/events and click on the nav to go to aboutus.html then, you get www.example.com/events/aboutus.htm. Which of course doesn't exist.
Yes, Don, we are using articles, and if you click on any individual article eg www.example.com/events/2015/09/30/new-article/ then the same behaviour happens: www.example.com/events/2015/09/30/new-article/aboutus.html.
I'm thinking we've screwed up htaccess with Babel or else the Furls System Settings are messed up.
-
- 131 Posts
Comp_nerd, I believe you are indeed a genius. Many, many thanks, that's fixed it - don't know why we hadn't got that in the head, but we didn't.
-
- 179 Posts
To be clear, <base> in the <head> isn't generally an absolute requirement for a webpage. I'm sure comp_nerd26 has a clearer understanding of how Article is using <base> in this case. Without specific Articles experience I'd have guessed that an incorrectly configured <base> in <head> would have been the cause of your problem, and in that case I'd have suggested removing it.
For example, I imagine <base href="[[~[[*id]]]]" /> would probably cause the problem you're seeing, or similar.
So to be clear, are you saying that Articles actually requires <base> to be used in this manner? I ask because I've had issue with <base> recently, using #tag links on a page to auto-scroll, and considered removing it to solve my problem, and staying rid of it until such a time as I found it to be necessary.
I noted it was included in the default template after a fresh Modx installation. Having done some research there are people who believe <base> is overused, for the wrong reasons, and on that basis it strikes me that a CMS shouldn't be generally dependent on it. But it'd be nice to know if <base href="[[++site_url]]" /> is considered a recommendation for Modx pages. I've certainly found it helpful with media sources, etc.
-
- 295 Posts
hi dave
yes I find it strange that a cms system should be so dependant on base href in the head (it does say its a requirement in the support docs). ive coded many websites using different cms and of course with no cms sysmtes of which do not require this.
The alternative to use the base tag is setting link_tag_scheme to abs; that will make sure links are not relative (news.html) but absolute (/news.html), which will also resolve the problem. For Wayfinder, this also needs to be set with a &scheme=`abs` property as that doesn't inherit the system setting properly.