Hi all - hope this isn’t a repeat, couldn’t find anything with search.
From what I can tell, all I can do in the ModX GUI is create a new template in which I can paste some HTML and other front end code. My problem is when I do this, I want to link to an external CSS file but I don’t know:
a) Where to upload the CSS file or
b) Where the template file goes when it’s created (in other words, I have no idea what the path TO the CSS file should be).
Anyone have any clue?
I assumed /assets/templates, but I don’t see the template file I created anywhere.
Thanks SO MUCH for any advice!
Iris*
There is no one set way of doing this.
I usually will build a static page first that points to my css and js files first. You can then copy the folder structure into the assets/templates folder like so: assets/templates/new_templateName/css/styles.css
Then when you create your template from within MODx you make sure you point to the css file using that path in the head of your template. The css file can be placed anywhere but the path to that file must be perfect.
Thanks, @webandflow and @Photowebmax!
I was trying to use a relative path to my files, but I suppose I may as well use a full URL, at least for now. Good call, both of you - I’ll give that a try and see if I can get things working logically - I’ll let you know.
Thanks for the quick responses!
I think if you add the following to the <head> section of your template, the paths can be left relative (to the root index.php file). This also makes it easier to move from dev to production.
<base href="[(site_url)]" /></base>
To my knowledge template *files* are in the database.
DEVELOPMENT ENV:- Ubuntu 12.04 | MODx Revolution 2.2.8 | LAMP 2i Apache 2.2.22 | Php 5.3.10 | Mysql 5.5.31 MySQL client version: 5.5.31
-
☆ A M B ☆
- 24,524 Posts
The template created in the GUI is stored in the database in the site_templates table. Everything managed through the GUI, including resources and all elements, is stored in the database.