Quanta CMS Coder's Guidelines
We have designed Quanta as a very versatile content management system giving its users lots of freedom and adapting to their favorite technologies.
Still, in order to make it perform at its very best, there are good practices to follow when developing a Quanta site. So we have prepared an easy set of guidelines for Quanta developers, to help them in the process and make Quanta development an effective and rewarding experience.
- Avoid using HTML in node templates, or in the index.html file
Yes. Seems like a nonsense, but Quanta's tpl files should always contain just qtags, and nothing more.
So, where does the HTML go? In qTags, of course. If you feel the need to add some extra HTML, just implement a custom qtag instead: you will be able to reuse this cool qtag forever, in all of your projects! Not to mention all the extra good stuff you can do with qtags.
- Think wide: reuse your qTags and custom modules
When writing a qTag, keep in mind that it will become part of your Quanta "swiss army knife"! You will be able to reuse it in other projects, extend it, and share it with other fellow developers. So always think wide, and build your tags flexible enough to become real useful components! Don't change a core module's scope when extending it
This especially applies to Quanta core contributors, but it's useful to everyone; if something has been done already, there is a reason. When adding a new parameter to an existing core method, make sure the parameter is optional, and the standard behavior keeps being the same as it was.
In some cases, a complete rewrite of a method is really necessary. In such cases, the community will agree to adapt and refactor their existing code, and a new major version of Quanta will be released.Don't use CSS for layouts where you can use qTag's grid
Quanta's qTags allow using grid attributes to create amazing layouts without the need to write a single line of css. Don't reinvent the wheel by implementing hand-made CSS if that can be avoided.Think wisely about your folder's naming conventions
As your node's folder names act not only as an unique key, but also as a reference for other resources pointing to them, in order to prevent you don't really want to change it very often. Moving folders around, rearranging, and reorganizing, is not a problem thanks to the doctor command line tool. But changing a folder's name, can result in broken links, and be difficult to fix.