What is a Module Class Suffix?

If you want a module to have a specific look, a certain width, different fonts, etc, you can enter a Module Class Suffix in the Advance tab for that module and target the styling. You can even make it so three modules side side by side in position-2 that sits under the content area.

When you put in a Module Class Suffix you can choose to add a space in front of the name or not. If you do not put a space, the term is appended to the end of whatever the default class is for that module position. If there is a space in front of the term, then it is not appended to any thing. 

What is a custom position?

If you want to add specific positions to the Protostar template, beyond the default positions already defined, you can create a custom position by editing the templateDetails.xml and index.php files that sit in the root of the Protostar folder in the templates folder.

What this does is allow you to create a specific spot in the template for this position. You can use this new position, or positions, to add a new location for a menu at the top of your page, for little side bars that stick out the side or for three modules to sit side by side in the footer area. When you create a custom position, it shows up in the dropdown list of positions in Module Manager. You module will go right where you want it. You can also add a containing <div> class or id so that you can target this location with specific styling.

Why would you use one method over the other?

Both of these method accomplish similar tasks. Each one has its limitations and each one has things that work better for specific situations.

Module Class Suffix: Pros and Cons

Pros

  • It is easy to add the Module Class Suffix
  • You don't have to edit the template files
  • You don't risk the style being lost when you upgrade Joomla

Cons

  • If the module is moved to another position, the Module Class Suffix goes with it. This can cause styling problems
  • If you have multiple contributors to your Joomla website, they may not know about the Module Class Suffix. If they leave it out it could harm the styling
  • You can only style a Module Class Suffix to a certain extent, you are still limited to the location of the position it is being assigned to

Custom Positions: Pros and Cons

Pros

  • The position name shows up in the dropdown position list for the template, so your module is put right in there without having to remember to add the Module Class Suffix
  • You move it, the styling for that location is removed automatically
  • You can really target where it sits in the template, it's styling and functionality
  • It is easier for other contributors to place, rather than knowing about the Module Class Suffix addition

Cons

  • You have to edit the templateDetails.xml and index.php
  • You risk losing this location when you upgrade and the edits to the templateDetails.xml and index.php must be repeated or replaced

 


Has BJ.Zemplate.com helped you with understanding Joomla?

If you would like to make a small contribution to help fund this resource, that would be great, but do not feel obligated in any way.

Donation Amounts


Still not finding a special topic?

Use Google's Search function below for search the content of bj.zemplate.com.