By default in MODx you get the base element with the base link for your website. Since that was causing some problems, I wanted to get rid of it. But doing that caused my Wayfinder menu (and possibly some other links) to fail, because the path was concatenated to the current url (friendly urls and containers enabled).
So I took a look at the option for link scheme (I believe the setting is called link_tag_scheme) but there wasn't an option to prepend a / to everything so it would link from the root or your domain. But there was an option abs (absolute) which used a value from a different setting.
As that setting wasn't available yet, I created a new record and gave it the value '/'. So now I have set my link scheme (global setting AND wayfinder parameter) to 'abs' so my links are correct and I could get rid of the base tag.
Have any of you encountered this problem before? How did you solve it? Is this a correct approach, or am I forgetting something (that could cause problems)?
[ed. note: might-e last edited this post 12 years, 11 months ago.]
Okay, the first problem has surfaced.
Links made using TinyMCE and the MODx browser (or whatever it is called) don't work as the are doc relative. I have tried setting the pluginsettings to rootrelative, but this doesn't seem to affect anything. Does anyone know how to solve this problem?
I'm not completely sure on what exactly you are trying to accomplish?
-
☆ A M B ☆
- 24,524 Posts
There is [[++site_url]], which is your full site's URL. There is [[++base_url]], which is usually just "/", or if your site is installed as a subdomain something like "/subdomain/".
By default, the link_tag_scheme is "rel" (relative), which will create relative URLs like "mypage.html". Using "abs" (absolute) will create absolute URLs like "/mypage.html" or "/subdomain/mypage.html". Using "full" will create a full URL, "domain.com/mypage.html".
-
MODX Staff
- 2,502 Posts
Since that was causing some problems, I wanted to get rid of it.
What problems was the
base element causing. It makes the most sense to solve that, rather than removing it. At this time, MODX FURLs rely on it, as do contexts.
If you could elaborate on what issues you're having and what you'd like to solve we may be able to find you a workable solution.
Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup
magician.
Blog ✦
Twitter ✦
LinkedIn ✦
GitHub
-
☆ A M B ☆
- 24,524 Posts
One problem I have had with using a base tag is that JQuery UI developers have decided that using it is evil, and will not fix their tabs code to work with one. JQuery UI tabs will load the entire page into a tab. This was fixed for previous versions, but they've decided not to do so for version since 1.9. There are a number of javascript patch to solve the problem. For example,
http://stackoverflow.com/questions/13837304/jquery-ui-non-ajax-tab-loading-whole-website-into-itself
But wouldn't it make way more sense to always generate links relative to the site root, prefixed with a '/'? MODx knows the current path and everything, so why are links made in a way that you need to use the base tag?
I just tried putting a '/' in the base tag and that seems to work nicely.