Changed structure of the demo-head and footerHTML#351
Changed structure of the demo-head and footerHTML#351azeller wants to merge 1 commit intomodxorg:3.xfrom
Conversation
I think it's a really bad idea to have one chunk with only opening tags and the other one with closing tags that depend on each other. I'd avoid that in any situation. Editors like Ace will always show you if you missed a closing tag, you can expand/collapse those, as long as your HTML is valid and consistent. Having it the way it is now is sloppy and something we've seen in a lot of MODX sites that other people built. If it's in the official documentation, we can't even blame them. I'd recommend changing this for several obvious reasons. The most important reason would be to easily check if your HTML is valid. Having to touch two chunks when adding an opening or a closing tag that is wrapping the entire page is just a bad idea.
|
I very regularly use that structure where the templates themselves contain very little actual markup so I don't immediately agree with your proposal being better as it'll cause duplication. Perhaps rather than replacing what's in the docs, offer it up as an alternative approach? There can be more than one way to do things that are all valid with their own pros/cons. |
|
That was the idea. I think this is a better way though, but everybody can do their own thing of course. After all, it's a PR that can be denied with no hard feelings whatsoever. Opening up eyes to different or better approaches only works if there's a concrete alternative ;) However, I can of course leave the original approach and put the other one side by side to it. I just thought it would be confusing to do so |
|
I don't want to decline pull requests, ever. ;) As the rest of the page builds upon the entire head markup being in the headerHtml chunk, it would be quite confusing to accept this as-is. Perhaps leave the chunk code as it is currently, but add a comment block (with
|
Explanation
I think it's a really bad idea to have one chunk with only opening tags and the other one with closing tags that depend on each other. I'd avoid that in any situation. Editors like Ace will always show you if you missed a closing tag, you can expand/collapse those, as long as your HTML is valid and consistent. Having it the way it is now is sloppy and something we've seen in a lot of MODX sites that other people built. If it's in the official documentation, we can't even blame them. I'd recommend changing this for several obvious reasons. The most important reason would be to easily check if your HTML is valid. Having to touch two chunks when adding an opening or a closing tag that is wrapping the entire page is just a bad idea.