MyBB Community Forums

Full Version: Template indentation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
This is something I noticed a while ago, but never got round to posting about.

I've noticed a major difference in certain templates throughout the MyBB core in that some of them are correctly indented while others simply aren't at all. It's not exactly a big issue, but according to the MyBB development standards, all code should be indented with a tab sized around 4 spaces.

I can understand why there's a variance between templates (I guess different people write different ones out after all), but it would look a lot neater if all the templates were indented correctly. I also realise that there's no point editing all the templates now for 1.6, but it would be nice to see them all indented correctly in future versions.
+1 Some of them are actually pretty hard to read.
I agree, I also find it weird that we're not able to indent them ourselves. (As far as I know, I donno if it's just a Chrome thing).
You can, though you need to either use 4 spaces, or paste it into notepad(++), indent it, then re-paste it into the editor. The wordpress editor (for example) lets you indent the code right there. I guess a new editor's inbound for 2.0 though.
I prefer just hitting 'tab' and indenting it for me, so when I need it to be indented I do paste it to the editor from NotePad++. Toungue
I do the same thing Wink I also turn off codepress in MyBB due to all the issues it can cause, so I user notepad++ anyway to make sure I don't miss any closing tags by mistake.
Ooh I've not tried turning off Codepress, but I know that it can mess a lot of things up. Perhaps I Should try that. :3
Codepress doesn't work in Chrome (or vice-versa, I'm not sure), so you can safely leave it enabled.

I've always turned it off since 1.4 when I had issues with it. The biggest one is when it doesn't save the whole template sometimes. It doesn't help anything much else, but it makes sure that the template saves correctly.
I agree with you that this could improve readability, although this only applies to the main templates. But in subtemplates (like 'postbit_author_user') you will have to add indentation to match the indentation of the main template , and this would make the subtemplates less readable I think.
Pages: 1 2