Hi,
I have set up a web server on my machine and installed MODx. All went well.
I have one file of my own in the root of my htdocs called index.html.
All OK so far.
I want to be able to make modifications to this file.
I’ve created a template using the HTML code from index.html and a temlpate variable called [*home_preamble*] for the part of the screen I want to edit.
I inserted [*home_preamble*] into template and I’m able to edit and save it.
It even shows up in the preview window, so I’m satisfied that I’m on the right track.
My problem occurs when I click ’Launch Site’. The new window displays the index.html that’s present in the root as the old version. I do not understand how I can link this file in MODx so changes to the [*home_preamble*] variable are displayed in to root html file. I hope this makes sense. I think I’m still very new to this and I’m reading through support documentation to work out what it is I’m not understanding.
Some pointers from the community would be very much appreciated to get me up and running with this excellent CMS. I’m very impressed and eager to start exploring it further.
Thank you
LiquidEyes
System Info:
apache_2.0.55-win32
php-4.3.11-Win32
mysql-3.23.38
OS: Win XP Pro SP2
-
MODX Staff
- 10,725 Posts
You need to remove the index.html file. This, minus page specific content (e.g. like home_preamble and the rest of the content unique to the home page), should become your Template for the site, which you need to save under the Manage Resources area of the MODx manager. Each virtual document you then create via the manager using that template will have it’s own [*content*] region where the main content for that page is edited.
Now, template Variables are for additional areas of editable content linked directly to a template. In the case of home_preamble though, since that sounds like something that will only appear on the home page, unless you might have a separate home page template from the other pages, I’d just use a chunk which is a static, editable, re-usable area of HTML content, called home_preamble and include it in the home-page content region (e.g. {{home_preamble}}) . Either way will work however, just want to point out though that with Template Variables, these editable regions will appear as an additional editable region on every page using the template it is assigned to.
The reason you are not seeing the site is because most Apache installations are setup to look for index.html first, instead of the main MODx URL at index.php which controls all MODx requests.
Cheers
-
☆ A M B ☆
- 24,524 Posts
You use the same template for pages; you can assign templates in the form when you create a document in Manager; you set a default template for the whole site in Manager’s Administration/System configuration. Documents are set to this template by default.
You can change the template the front-end NewsPublisher system uses in the options given to the snippet:
[[NewsPublisher? &template=`NewTemplate`]]
The best way to learn is to read the Documentation, and to look at the documents and templates used in the installation.
Thanks for all your help.
It’s starting to make sense and MODx is so intuitive once you’re off the ground.
I’ve only been working with it for about 20 hours including install, reading docs and playing around and already I’m realizing the freedom and power it provides.
I’ll read through the links you’ve supplied and thank you very much for your prompt replies.
Regards
LE