|
Joomla Template Kit 3.X Manual
|
CSSJoomla's CSS is one of the most confusing parts of Joomla for beginners and pros alike.
The module or modules called by the module position can have there own HTML formatting to control the data layout that are hard coded into the module itself. Then depending on the module style parameter set in the module position call in the template every module assigned to that module position gets a chrome wrapper. That can be any in the above chart by default.Now the output of the chrome wrapper can be nothing or a table or single DIV tag or many DIV tags that surround the module data. Now the question is what CSS style or styles that effects the module style chrome wrapper? There are two classes ".moduletable" The ".moduletable" class effects the module position parameter styles table and horz. If you look at the output of the HTML code you see that Class parameter is set to ".moduletable" class and there is a underscore and the *Suffix I'll get to the suffix part later on. Now it makes sense that the class name is called ".moduletable" because both wrappers are tables. Now this not a lesson on CSS but you can now build on the class using CSS code that deals with table elements. ".module" The ".module" class effects the module position parameter styles xhtml and rounded. If you look at the output of the HTML code you see that Class parameter is set to ".module" class and there is a underscore and the *Suffix I'll get to the suffix part later on. Now it makes sense that the class name is called ".module" because both wrappers are DIV's. Now this not a lesson on CSS but you can now build on the class using CSS code that deals with DIV elements. What's a Module Suffix? A module suffix is like a last name so if the class name was ".Brian" the suffix is the last name of a person in my case Diaz. So the class would look like this ".Brian_Diaz". So how does this help with Joomla styles? Well I'm not the only ".Brian" in the world. There can be ".Brian_Dias" we share the same first name the last name makes us different. There are two main module chrome wrappers styles ".moduletable" for table element styles and ".module" for DIV element styles. Now we can have many modules on a template as many as you like. But where going to run into a design problem soon why? Because there are only two CSS styles class for us to use! ".moduletable" & ".module" So here is where module suffix come in just like a last name it changes who the person is. But keeps the same first name ".moduletable" for tables or a ".module" for DIV's. If you added a module include tag for a module in the template with module parameter Style=xhtml output would be "<div class="moduletable">". If the suffix is not set it will not print out the "_*Suffix" part just the ".moduletable" part which would give you the default style set in the modules.css style sheet. The module suffix is set via the Joomla module manager. ![]() ".moduletable" class with a suffix to the modules.css file ![]() You would get a red background on that module Chrome Wrapper with the "_Diaz" suffix on it and everything else the uses the ".moduletable" class would have a white background. So you can add as many module suffixes to your style sheet as you like to give your template modules a different look. Just remember to build on the default module classes. A another question that maybe asked is why the underscore with the suffix name? Well it does not have to be an underscore but needs to be a character that's not a letter or number. A "-" dash or underscore work best it easier to ID the class. Lastly for this suffix discussion I mention above that ".moduletable" was for module position parameter styles tables and that ".module" class was for Div elements. This is not all the way true. I believe that it was a design mistake made by the Mambo CMS and was then carried over to Joomla. If you notice that module parameter Style=xhtml style class is ".moduletable" not ".module". and its outputs are div tags. I think of xhtml markup as div's tags etc. as most designers do. So the module parameter Style=xhtml style class should be ".module" but it's not. I just wanted to point that out so you don't start emailing about a typo but something that's been there from the Mambo days. Another major part of the CSS in Joomla is the menu system. It can not be explained in one quick paragraph see the Joomla Menu System for more information on the CSS styles and menu system itself. Just keep this in mind the Joomla default menus are tied into the module system. Every menu has at lease one module and as a module the module chrome wrapper rules apply to menus as well. Menus are called just like any other module but have another layer of style control based on Menu Style parameter set in the Module Manager. |