Community

Noob question, how to best create a page in ModX

I’m new to ModX and I’d like to create a page like Apknite in it. I know the basics of ModX, so I know that I should create a template file for a page to use, and then fill the resource field with the content that [[$content]] spits out. Really the thing that bothers me is that the person who edited the page before me had every different section of a page split up into multiple different resources, but I’d like to have just one resource file and one template file for the entire page that I’m remaking. I know have the header, main content (where the [[$content]] gets spit out) and footer inside a template file. And now I call that template file inside one resource file where I add the rest of the HTML for the content that gets spit out on the page. Is this the proper way to split up the creation of a page in ModX? Really what it boils down to is what should be inside the template file, and what should be inside the resource file?

Normally stuff like the footer will be chunks, but resources is also ok. Put em all in a folder so you know where they are.

Normally the resource has only the text, links, or snippet needed for that page.

Keep in mind code may be affected by TINYMce, so putting a bunch of html in the resource may require you to keep the editor out of that resource.

Even dynamic tools don’t need to be in the resource. If I have a snippet which loads after the content section and gathers keywords from the content text, that would be fine left in the template

1 Like

The bare basic you can setup is:

  • chunk 1: header (tpl header)
  • chunk 2: footer (tpl footer)
  • Template 1: home (build up your page)

Home:
[[$header]]
[[*content]]
[[$footer]]

Now, in your resource select your new created template and fill up the content field.

Good luck!

2 Likes