Jump to content

Hiding Sidebar


TAV1702

Recommended Posts

Ok folks, one last good one for today and then I believe I am going to be done for today.

We all know to hide a sidebar area or anything else for that matter we can use the following

<?php 
               if($_GET['module'] == 'frontpage')
               { ?>
		CONTENT CODE PLACED HERE WILL ONLY SHOW UP ON FRONTPAGE NOW	
			<?php
        } 
?>

I have 1 page that on my whole site that I do not wish for the sidebar to show up on. That is the Timetable module page. On the time tables to go 2 wide is just not good looking. I would rather it be pull page width.

So how would I use the above code to hide the sidebar area ONLY on the Timetable page? If I place that bit of code on my layout.tpl page and hide the sidebar as it is, it will hide the sidebar on every single page of my site and that is not what I am after. I want to hide it ONLY on the one page.

I am real good at confusing people and hopes I have not done it this time. ;)

Thanks for reading my post.

Ray

Link to comment
Share on other sites

Yeah the code I posted will do exactly what you want to do. As to where to put it, simply follow how I posted it.

Give me a few and I can come back and give an example. You will have to play with it though to get it right. It will badly bust up your template until you get it situated properly. And for the record, when you do hide that stuff on all the other pages, be prepared to go in and do some major css work to make the other pages look normal. Because all it is going to do is make the stuff go away. It will leave a big blank spot on your pages. You will need to rework your css to make up for the missing content on the other pages.

Link to comment
Share on other sites

Here is the code hiding the left sidebar on Obsessblue template Now please note, I am leaving out some of the content but you will get the main point.

TO hide side bar,

 <div class="mcontent">
<?php 
               if($_GET['module'] == 'frontpage')
               { ?>
               <div class="mcleft">

                   <div class="mcbox01">

                       <div class="th">

                           MAIN MENU

                       </div>

Now since we placed it where we did, we are hiding the entire left content.

Now find the very last closing div tag on you page and make it look something like this.

<?php
        } 
?>

               </div>

I left out most of the left bar code to shorten this post. I hope I got you on the right path. Like I said, when you go hiding stuff, it creates MAJOR work to do on the rest of your site. That is why I am only wanting to hide the sidearea content on one page only.

Link to comment
Share on other sites

Here is the code hiding the left sidebar on Obsessblue template Now please note, I am leaving out some of the content but you will get the main point.

TO hide side bar,

 <div class="mcontent">
<?php 
               if($_GET['module'] == 'frontpage')
               { ?>
               <div class="mcleft">

                   <div class="mcbox01">

                       <div class="th">

                           MAIN MENU

                       </div>

Now since we placed it where we did, we are hiding the entire left content.

Now find the very last closing div tag on you page and make it look something like this.

<?php
        } 
?>

               </div>

I left out most of the left bar code to shorten this post. I hope I got you on the right path. Like I said, when you go hiding stuff, it creates MAJOR work to do on the rest of your site. That is why I am only wanting to hide the sidearea content on one page only.

Oh and this will go in your layout.tpl file I believe. If not, then check frontpage_main.tpl

Link to comment
Share on other sites

Hrm...hoped that it works without major css changes ;)

Will try it and see what happens!

Thanks!

EDIT:

Thanks now it's clear how and where to place it!

No probs chief. If you have any issues with it let me know. I will see what I can do to help. I gotta split here in a bit to head to the Moose Lodge so help may not be available from me tonight. Others though know more than I do. ;)

Link to comment
Share on other sites

yeah, lol you will be editing your css. when you get the sidebar hidden, you will see what I am talking about.

Remember, for every action there equal but opposite action....Or something like that.

I already deleted the sidebar code in my layout.tpl and saw that the width of the main-area didn't change so I thought I made a mistake but wel...now I know...change CSS :huh:;)

Link to comment
Share on other sites

  • Administrators

I have 1 page that on my whole site that I do not wish for the sidebar to show up on. That is the Timetable module page. On the time tables to go 2 wide is just not good looking. I would rather it be pull page width.

So how would I use the above code to hide the sidebar area ONLY on the Timetable page? If I place that bit of code on my layout.tpl page and hide the sidebar as it is, it will hide the sidebar on every single page of my site and that is not what I am after. I want to hide it ONLY on the one page.

I think your thread got hijacked here, if you are still trying to NOT show the sidebar in the timetable module, you can do;

<?php if(MainController::$activeModule != 'TIMETABLE')
         { 
                //show the sidebar
         }
?>

  • Like 1
Link to comment
Share on other sites

And I simply place that in my layout.tpl file at the top or before the side bar area? Or in the time table.tpl file? +1 for the reply. I appreciate it.

And I'm guilty of hijacking to from time to time. lol as long as I was able to help someone for once, then I am perfectly content. ;)

Link to comment
Share on other sites

Ok I can hide the sidebar area using the code I posted, but if trying with the code you suggested I try, I get an unexpected error. I need to go back and redo the code and copy the code. I am such a blonde some times. :blink:

EDIT

Here is the error

Parse error: syntax error, unexpected '<' in /home/xxxxxx/public_html/xxxxxx/lib/skins/brilliancev1/layout.tpl on line 173

That error occurs right after I put the

<?php if(MainController::$activeModule != 'TIMETABLE')
         { 

In Place

If I try using

<?php if(MainController::$activeModule != 'TIMETABLE')
         { ?>

Nothing happens. No error, and the pages remain the same with nothing hidden.

Link to comment
Share on other sites

Well, I just went ahead and hid the entire side area except for on the home page and MAN Brilliance is not easy to tweak compared to Obsessblue. I quickly un-hid the side area which sux. Some of my pages are so cramped it is not funny. Good thing it is only a test site.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...