About disable right column

Everything to do with Joomla! 3.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
lucablue
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Sat Dec 22, 2007 8:15 pm

About disable right column

Postby lucablue » Sun Apr 15, 2018 10:51 am

Hi,
I'm using different modules on right column of my template. Is some website's pages I won't show all right column module.

Is there a way to disable all the right column in those pages instead apply it module by module?

Thank you

JohnSmithers
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 151
Joined: Mon Feb 11, 2013 9:22 am

Re: About disable right column

Postby JohnSmithers » Mon Apr 16, 2018 4:42 pm

Do you have a link please?

I'm having a little difficulty following what it is you are trying to acheive. Can you explain a little more clearer in reference to your link?

User avatar
tijjk
Joomla! Intern
Joomla! Intern
Posts: 52
Joined: Mon Sep 11, 2017 5:18 pm
Location: OH, United States
Contact:

Re: About disable right column

Postby tijjk » Mon Apr 16, 2018 11:01 pm

lucablue wrote:Hi,
I'm using different modules on right column of my template. Is some website's pages I won't show all right column module.

Is there a way to disable all the right column in those pages instead apply it module by module?

Thank you


Sounds like you want to disable the entire 'right column' position on certain pages. It is possible but I will need to see your template's files.

On protostar, this is how you can do it. Open index.php file in the templates/protostar folder.

Change

Code: Select all

            <?php if ($position7ModuleCount) : ?>
               <div id="aside" class="span3">
                  <!-- Begin Right Sidebar -->
                  <jdoc:include type="modules" name="position-7" style="well" />
                  <!-- End Right Sidebar -->
               </div>
            <?php endif; ?>


TO

Code: Select all

            <?php
            // get application
               $app   = JFactory::getApplication();

               // get menu
               $menu   = $app->getMenu();

               // get active menu id
               $activeId = $menu->getActive()->id;
               ?>
            <?php if ($position7ModuleCount) : ?>
               <?php if ($activeId != 101 ): ?>
                  <div id="aside" class="span3">
                     <!-- Begin Right Sidebar -->
                     <jdoc:include type="modules" name="position-7" style="well" />
                     <!-- End Right Sidebar -->
                  </div>
               <?php endif; ?>
            <?php endif; ?>


This sample code will disable right column module on all pages except 101 (id of the home page). Similarly, you can find IDs of other pages and adjust this "IF" condition accordingly.
The fastest Joomla templates on the planet

https://starazure.com/home/speed-comparison
Its free

lucablue
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Sat Dec 22, 2007 8:15 pm

Re: About disable right column

Postby lucablue » Tue Apr 17, 2018 1:26 am

Ok, understood.
Thank you. So is not possibile directly from admin panel, I need to change everytime the index.php code?

User avatar
tijjk
Joomla! Intern
Joomla! Intern
Posts: 52
Joined: Mon Sep 11, 2017 5:18 pm
Location: OH, United States
Contact:

Re: About disable right column

Postby tijjk » Wed Apr 18, 2018 3:39 am

lucablue wrote:Ok, understood.
Thank you. So is not possibile directly from admin panel, I need to change everytime the index.php code?

Don’t publish any modules in the right column on pages you don’t want the right column. That’s how everyone else does it from the admin panel.
The fastest Joomla templates on the planet

https://starazure.com/home/speed-comparison
Its free


Return to “Templates for Joomla! 3.x”

Who is online

Users browsing this forum: No registered users and 3 guests