Having installed my candidate modx site. I want it as clean as possible so I omit to sample site and end up with a site with a single page.
Step 1 is to create a template for the home page and then create a document from that template and then to make that the site start page.
First problem, I can’t import the html files, I’m expected to copy and paste their contents, you can’t be serious! it should be possible for all editing/creation tools to include an external file at the current position within the edit buffer. In the real world, people will use external templates, version control etc and MODx should be able to easily integrate externally managed files within a site. Equally it should be possible to replace some or all of an existing template by the contents of an external file. I regard this as a serious shortcoming.
A question, when creating a document, it gets doc id 2 and I have to edit the site system configuration to change the doc ids for the start, error pages etc to 2. I have deleted the document with id 1 but it is displayed crossed through, how do I make it go away? Having done that how do I get my home page to have doc id 1? Is replacing the default doc by the contents of my own the only way?
Ed
-
☆ A M B ☆
- 24,524 Posts
So make a snippet,
include /path/to/myfile/myfile.php;
return;
and use the snippet in the template form textarea.
Why delete the default document? Just edit it.
To undelete a document, right-click and undelete. To remove deleted documents, click the little trash can icon at the top of the document tree.
-
☆ A M B ☆
- 24,524 Posts
Think of snippets as wrappers for inline PHP code.
Of course, in the file you are including, you can have all the inline stuff you like.