How to improve Joomla module nomenclature and semantics
Written by Jeremy Wilken
Module names in Joomla are often unfriendly to users and for semantics, but also creating better names makes it harder to interface a new template with the default content. What do we do?
I've worked with many templates for Joomla, and they tend to have at least a few basic module positions. Examples are right, left, user1, user2, user3, user4 etc. The module positions from the default template also use these types of positions, which is where it seems most templates derive their basic nomenclature.
When templates use the module position names from the default template (something that has been done since Mambo), it makes it easier for new users to install different templates on a fresh copy of Joomla with the default content. That is because the content is directly tied to the template's module positions. Logically this makes sense, and it provides beginners with a little boost. However, it has some other negative side effects.
Problems with module positions
First and foremost, many of these module position names don't really mean anything. What does 'user1' signify? Nothing really. Its not semantic, meaning that user1 will hold anything and everything that could be put into a module.
The administrator has to use these names to assign modules, and when someone is placing modules via the Module Manager in Joomla, they have to know where all of these positions are on the page. This is minimized with commercial templates and some free ones that include a diagram with positions, but this is not always available. Regardless, it makes administering modules more difficult.
Secondly, these modules often have CSS classes that correspond to the module names. When we wrap our module with an id of "user1", we lose semantic meaning in our markup. If you are unfamiliar with some concepts of semantic markup, one of the foundations is to use meaningful markup. An example would be instead of "user1" or "left", we would rather see div with an id of "newsflash" or "search". These names give meaning to its contents rather than an arbitrary name.
The question then arises if a template nomenclature forces a site to conform its content to the template's design. For instance, if we have a position named "search", what happens when someone wants to use it for breadcrumbs or a little advertisement instead? This is where we start to desire things that Joomla doesn't currently handle.
What do we do?
Its my belief that using old module positions with meaningless names should be phased out. I know that people who produce templates will not want to hear this, because if they did this I would expect a rise in support requests. New users may have more trouble working with module positions that don't fit the default content. However many also provide a quick start type package which has their template installed with custom demo content. This is one solution, another is to just simply provide better training and documentation.
I also challenge that the default template for Joomla 1.6 should also have a better example with meaningful position names. Hopefully this will be carefully considered so that the module positions used in this template will be very common needs across all templates.
There are more things that can be done, but it seems to be largely in the hands of those who create templates. Joomla templates are extremely flexible, which is great for developers, but this is an example of a standard that should be used in the future.
About Gnome on the run
We are a full web development studio located in the Houston, Texas area. We blog about websites, video, design, business, web analytics, conversion tracking, and various open source projects we work with.
You can track us on the following networks and ways.
Blog Categories
Interested in us?
If you have a project you'd like to ask us about, feel free to request a free consultation from us.
