test
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • jfrederiksen Friend
    #206022

    Hi,

    I would like to add a vertical position between Component and Sidebar (see attached image).
    The new position should be same width as Sidebar.

    How can I do that?

    Cheers,


    1. adding-pos
    TomC Moderator
    #569153

    Perhaps the following tutorial will be of assistance –> http://www.joomlart.com/forums/topic/how-to-create-new-module-position-updated/

    jfrederiksen Friend
    #569292

    Hi Tom,

    Thanks for the link.

    I have read it all and watched the videos, but I still can’t get it to work.

    My problem is that the new position is put on top or below “Sidebar” – so in the same column.
    So far not matter what I have done, I can’t create an extra column between “Component/message” and “Sidebar”.

    I have attached a screenshot of the layout as it looks now and mainbody.php.

    It is all running locally as test, so I can’t provide a link.

    What am I missing? Clearly I am missing some code somewhere that creates that extra column.

    Cheers,


    1. pos-left
    1. mainbody.php
    Saguaros Moderator
    #569464

    Hi

    At the beginning of this mainbody.php file, you will see this snippet of code:


    $sidebar = 'sidebar';
    $hasSidebar = $this->countModules ($sidebar);
    $mainwidth = $hasSidebar ? ' col-md-9' : ' col-md-12';

    Our T3 framework implements Bootstrap which uses the grid system (12 grids). With above configuration, the main content will have 9 grid columns wide and the remained 3 grid columns wide is for the sidebar. That’s why when you add the new sidebar, it appears above the current sidebar.

    If you want to add a new sidebar display vertically along with main component block and current sidebar, you will need to customize the mainbody block so that it will have 4 cases:
    – mainbody + two sidebars ( 6 grids + 6 grids )
    – mainbody + sidebar-1 ( 9 grids + 3 grids )
    – mainbody + sidebar-2 ( 9 grids + 3 grids )
    – mainbody only (no sidebar) ( 12 grids )

    For each case, it will require to set the number of grids for each block.

    jfrederiksen Friend
    #569518

    Hi Saguaros,

    What you are writing here I also found out this night, but even with your added information I can?t get it to work!

    $sidebar = ‘sidebar’;
    $sidebarleft = ‘sidebarleft’;
    $hasSidebar = $this->countModules ($sidebar);
    $hasSidebarleft = $this->countModules ($sidebarleft);
    $mainwidth = $hasSidebar ? ‘ col-md-9’ : ‘ col-md-12’;
    $mainwidth = $hasSidebarleft ? ‘ col-md-6’ : ‘ col-md-12’;
    ?>

    I have added the above code.

    Sidebar will always be shown. On all pages, no matter what!
    Sidebarleft will only be shown on some pages.

    With this code, my main page looks as it should. When I click an article, Sidebarleft is gone as I should, BUT my normal Sidebar has now been moved to the bottom of my page, below the article and in the left side.

    And how to I define the “- mainbody + two sidebars ( 6 grids + 6 grids )”?
    I have tried fx. “$mainwidth = $hasSidebar AND $hasSidebarleft ? ‘ col-md-6’ : ‘ col-md-12’;”

    Cheers,

    Saguaros Moderator
    #569636

    You can try with my tweak here:
    – Take a backup of ‘mainbody.php’ file
    – Download the attached file & unzip into directory: ROOT/templates/ja_teline_v/tpls/blocks/ (the attachment includes ‘mainbody’ folder and ‘mainbody.php’ file)

    Hope this helps!!!


    Saguaros Moderator
    #734725

    You can try with my tweak here:
    – Take a backup of ‘mainbody.php’ file
    – Download the attached file & unzip into directory: ROOT/templates/ja_teline_v/tpls/blocks/ (the attachment includes ‘mainbody’ folder and ‘mainbody.php’ file)

    Hope this helps!!!

    jfrederiksen Friend
    #569761

    Hi,

    Thanks for your code.

    I could not get it to work, but after looking through it for a while it gave me some tips.

    This is how my code in top of mainbody.php looks like now:

    $sidebar = ‘sidebar’;
    $sidebarleft = ‘sidebarleft’;
    $hassidebar = $this->countModules ($sidebar);
    $hassidebarleft = $this->countModules ($sidebarleft);

    if ($hassidebarleft) {
    $mainwidth = $hassidebar ? ‘ col-md-6’ : ‘ col-md-12’;
    } else {
    $mainwidth = $hassidebar ? ‘ col-md-9’ : ‘ col-md-12’;
    }

    Very simple and I only have the mainbody.php file to look after.

    Now, to anybody who read this. I am not the best PHP programmer and though I have tested the above code without seeing any problems, please test it yourself before using it!

    If anybody see a problem with this code, please let me know.

    Cheers,

Viewing 8 posts - 1 through 8 (of 8 total)

This topic contains 8 replies, has 3 voices, and was last updated by  Saguaros 9 years, 7 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum