Search code examples
joomlamodulewebpositioning

Make a Joomla module take up two positions


I've searched for this question but I don't know if I've phrased it correctly. I'm working on a Joomla website and on one of the pages I have three module positions content-top-a content-top-b content-top-c So essentially the page width is divided into thirds. But instead of having three modules on this page, I want one module to take up the first third of the page and another module beside it taking up the other two thirds of the page. But when I assign the first module to content-top-a and the other module to content-top-b it just sets both modules to the same width and divides the page 1/2 | 1/2 rather than 1/3 | 2/3

I'm fairly new to Joomla so I hope I got that question across alright. Thanks in advance for any direction.


Solution

  • This will be a template edit. You will need to look at the css files for the template and add some php code to make it check if only 2 modules are published to only 2 module positions of the 3.

    And if only 2, then have a class added to those 2 postions, with some styles on it like below:

    <style>
    .class1-position { width: 33%; }
    .class2-positions { width: 67%; }
    </style>
    

    Or if you know the site width, then set that to px for the width of the modules and don't use percentage (%).

    Here is some php code for checking if the modules are published

    if(countModules('position-1')):
        // Some code
    endif;
    

    But to fully answer your question I would have to see some code, there are so many variables that I don't know, with what type of template you are working with. But this will definitely get you headed in the right direction.