I ran across MODx on Thursday, downloaded it that evening and have been trying to work with it since. My sites are currently on Joomla and Im trying to convert a template I used there. This template was an open source template from oswd.org so I went and downloaded it again to start from scratch.
There are, however a few issues I have run into Im trying to deal with.
1. Is there a way to short hand the path to files and such? I saw [(rb_base_dir)] and [(rb_base_url)] in the documentation, but Im not quite sure how to use them and if they represent the path to the root of the site or something like that and if I can change the paths they point to.
I also so <base href="[(site_url)]"></base> in one of the default templates, but again Im not sure how to use it. Can I use chunks inside the head tags? For say something like paths to the css file, {{my_path_to_css}}?
2. I got a basic template set up, put in [*longtitle*] and [*content] so I would have something generated on the front page to see if I had pointed to the css file correctly. In Firefox everything works like a champ, no problems whatsoever. However, in IE7, it does not see the css file. It pulls up the page, but there is no styling. What strange is that I can switch to another built in template and Firefox still works fine but then so does IE7. So Im not sure whats going on there.
Thats it for now. Im running into trouble with those things. Just so I know I understand the process, the templates within the template folder dont actually hold the templates? The just have the images and css files and any other things that make it all work, correct? The coding for the template is actually stored within the resources manager of MODx, correct?
Anyway, thanks for the help. Im looking forward to getting a site up and running with MODx, but I gotta get through the learning curve. I thought having used Etomite and gotten a little comfortable with it that I would be okay with MODx but it has been quite some time since I actually used and I guess all that learning has slipped away somewhere.
I got the issue with IE7 worked out. There were two css files included with the template and one was labeled as alternate, link rel="stylesheet alternate". I ditched the main css file and used the alternate as I liked it better. Apparently IE7 doesn’t like that extra word in there. I removed the word alternate and everything shows up fine in both browsers.
I also tried a chunk in the head and that too worked. I created a chunk with the path to the template folder and everything worked just fine.
<link rel="stylesheet" type="text/css" href="{{css_path}}onecolumn_css.css" media="screen" />
I would still like to know what
<base href="[(site_url)]"></base>
[(rb_base_dir)]
[(rb_base_url)]
is and how to use them though if someone could help out with that.
-
MODX Staff
- 12,272 Posts
I typically put <base href="[(site_url)]" /> into my templates above anything that has a path. Don’t use rb_base_url ... as that belongs to the resource browser and is potentially a bad idea... what if the location of the resource browser changed at a later date?
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
If you are trying to link the internal pages, use this syntax: [~123~] ... where 123 is a id of the target document, this will automatically generate the url based on your MODx configuration.
-
MODX Staff
- 12,272 Posts
Base HREFs are part of the HTML spec, and does in fact tell it to make all relative links be "based" on that starting point. [(site_url)] is one of the site objects that tells it to insert the site of the currently installed URL. This is handy especially when moving from staging to a live server as you have to change much less in order to get your site to work.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me