mallchin.com

mallchin.com header graphic
Home arrow Misc. Code arrow Joomla! arrow Joomla! - Module Class Suffix
Joomla! - Module Class Suffix PDF Print E-mail
Wednesday, 10 January 2007

One of Joomla!'s excellent features is the ease with which we can customise content, in this case modules, through CSS. There are 2 parameters which handle the styling of modules, Menu Class Suffix and Module Class Suffix.

These are defined in the configuration screen for each module. However, not all modules include this parameter, but we can edit the XML file associated with the module to add it in -- here I show you how.

Browse to the modules/ folder and locate the files for the module (you can find the name by looking in the right column in the modules under admin). In my example I will be looking at mod_mainmenu. For this module we have 2 files, mod_mainmenu.php and mod_mainmenu.xml.

The PHP file contains the logic for the module, and the XML contains the configuration. Open up the XML file in your favourite editor and paste the following code in at the bottom:

  1. <parmas>
  2. <param name="class_sfx" type="text" default="" label="Menu Class Suffix" description="A suffix to be applied to the css class of the menu items" />
  3. <param name="moduleclass_sfx" type="text" default="" label="Module Class Suffix" description="A suffix to be applied to the css class of the module (table.moduletable), this allows individual module styling" />
  4. </params>
 

If your file already has some parameters defined simply add the additional parameters like so:

  1. <params>
  2. ...insert <param ...> lines from above here followed by a tidy spacer (the line below)...
  3. <param name="@spacer" type="spacer" default="" label="" description="" />
  4. ...alread defined <param> lines go here...
  5. </params>
 

Once you've edited the file save and upload to your site. You should now have the 2 parameters Menu Class Suffix and Module Class Suffix available in your module under the configuration screen.


Quote this article on your site

  Be first to comment this article
RSS comments

Only registered users can write comments.
Please login or register.

 

  Tag it:blogmarksco.mmentsDeliciousdiggDiigo