Skip to main content

Creating a Joomla! Module Position

I know how it works. At least I did, once... I tend to forget, thus I'll write it down once and for all.

Step 1: Adding the position to the correct xml file

Go to your template's root folder (usually <Joomla-Root>/templates/<your-template>) and open templateDetails.xml in a text editor. Scroll down 'til  you find <position>-tags. At the end of the row of position tags, add another one (just clone the last tag and increase the number by 1). Save.

before
after

Step 2: Check if what you just did worked

Go to your Joomla! backend. Open Extensions > Module Manager. Select a module (open the module item by clicking on it). Click "Select Position". Does the position you just created appear in the table? Good!


Step 3: Name your position (optional)

Now you can give your position a name. The name is what appears in brackets in the position table. Go to the <Joomla-Root>/administrator/language/<your-language> folder. Open file <your-language>.com_modules.ini (for example en-GB.com_modules.ini) in a text editor. Look for a line that reads 'COM_MODULES_POSITION_POSITION-18="Position 18"' (where 18 would be the number of your new position -1) and add a line for your new position (i. e. 'COM_MODULES_POSITION_POSITION-19="Position 19"'). Save. (By the way: you can specify whatever you want to be the name of your position. It doesn't have to be "Position -<NumberOfPosition>")


Step 4: Insert the position in index.php

All that's missing is the tag that specifies where your position should be included. Go to your template's root folder (usually <Joomla-Root>/templates/<your template>) and open index.php in a text editor. Go to the position where you want to include the position and insert a tag similar to this one:
<jdoc:include type="modules" name="position-19" />
Replace "position-19" with the correct information you entered in the xml file (this is NOT the name you specified in the language file!).


Step 5: Assigning a module to the position

Well, you should know how this works. Just open Extensions > Module Manager in your Joomla! backend, open a module, click "select position" and select your new very special own position. Reload your page to see if everything worked (clearing your cache might be necessary).


Let me know if you had any problems with this!

Comments

Popular posts from this blog

Joomla! 2.5: Multiple views, one model

Here goes MVC again: I was a bit confused that every time I created a second or third view for a component, I had to create a separate model for it. Did not make sense to me - I had the necessary algorithms in the model for the first view, did I really need to do copy & paste? I hate it! Redundancy, redundancy, redundancy. That case occurred in my current project - I created user profiles and needed an "edit" view. The data is the same, but I need to have the data in editable text fields instead of fixed labels, and maybe some other buttons here and there...  Well, some time later I realized that I just did not quite understand what Joomla! acutally means by "view".  And that there is something called "layout". Long story short: If you have a model that provides all necessary information and you just want to have a different presentation of it, just add a new .php file to your views/<yourviewname>/tmpl folder - let's call it "layo...

Galaxy S5 Lollipop Update Issue

Disclaimer: getting anything wrong with flashing might brick your device - this is not a manual. I am not responsible for any damage to your phone or data...  -- So I finally checked the software update availability on my Samsung Galaxy S5, and guess what - the Android 5.0 update was available. Finally. I cleared up some space on my phone (it claims that it needs 3 GB of free space for the installation) and started the update. It is a big image (1.4 GB), so it takes a while to download, then the phone shuts down, restarts, and starts to install. I started wondering when the installation process started at 25%, went down to 1, up to 20, 30% and then - "error". Phone restarts, everything OK except for the fact that I still have KitKat on my phone. Tried again. Same result. Tried again. Same result. Googled it. No results. Nobody seemed to run into that same error. There was indeed an error message after the phone restarted successfully - "Try it again, try Kies or go...

Using opOSSum with ScanCode Output - How to Convert ScanCode Output JSON to Opossum JSON

 opOSSum is a nice Open Source compliance tool which can be found on GitHub . ScanCode is another nice Open Source compliance tool which can be found on GitHub , too. While the latter provides extensive code scanning functionality, the former can create comprehensive reports and visualize scan results. One just has to figure out how to get opOSSum to read ScanCode output.  This is not really an issue, but - as far as I can tell - has not yet been documented anywhere on the internet. opOSSum does read ScanCode json output, but it reqires some transformation beforehand. Good news: opOSSum also provides the tool to perform said transformation.  As usual, this is more of a step-by-step-guide for noobs such as myself for future reference, but I figured maybe this can be of use for the community as well.  Prerequisites:  1. Get ScanCode Just get it from https://github.com/nexB/scancode-toolkit...