# Hiding Sidebar

**URL:** <https://forum.phpvms.net/t/hiding-sidebar/4217>\
**Category:** Skinning - Legacy phpVMS (v2/v5)\
**Created:** [March 2, 2011, 9:18pm UTC](https://forum.phpvms.net/t/hiding-sidebar/4217 "2011-03-02T21:18:17Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![TAV1702](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tav1702/32/41_2.png) [@TAV1702](https://forum.phpvms.net/u/TAV1702)\
**Post date:** [March 2, 2011, 9:18pm UTC](https://forum.phpvms.net/t/hiding-sidebar/4217/1 "2011-03-02T21:18:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Sascha\_DCS299](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/s/ad7895/32.png) [@Sascha\_DCS299](https://forum.phpvms.net/u/Sascha_DCS299)\
**Post date:** [March 2, 2011, 9:26pm UTC](https://forum.phpvms.net/t/hiding-sidebar/4217/2 "2011-03-02T21:26:24Z")

</div>

I have a smiliar problem!

I want to hide the sidebar on every page but the frontpage!

Can I do this with the code you posted above?

How does it work? Where do I find/write it in the .tpl?

---

<div class="post-metadata">

**Author:** ![TAV1702](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tav1702/32/41_2.png) [@TAV1702](https://forum.phpvms.net/u/TAV1702)\
**Post date:** [March 2, 2011, 9:35pm UTC](https://forum.phpvms.net/t/hiding-sidebar/4217/3 "2011-03-02T21:35:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TAV1702](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tav1702/32/41_2.png) [@TAV1702](https://forum.phpvms.net/u/TAV1702)\
**Post date:** [March 2, 2011, 9:39pm UTC](https://forum.phpvms.net/t/hiding-sidebar/4217/4 "2011-03-02T21:39:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TAV1702](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tav1702/32/41_2.png) [@TAV1702](https://forum.phpvms.net/u/TAV1702)\
**Post date:** [March 2, 2011, 9:39pm UTC](https://forum.phpvms.net/t/hiding-sidebar/4217/5 "2011-03-02T21:39:57Z")

</div>

> 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,
> 
> \<?php if($\_GET['module'] == 'frontpage') { ?\>
> 
> MAIN MENU
> 
> 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 } ?\>
> 
> 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

---

<div class="post-metadata">

**Author:** ![Sascha\_DCS299](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/s/ad7895/32.png) [@Sascha\_DCS299](https://forum.phpvms.net/u/Sascha_DCS299)\
**Post date:** [March 2, 2011, 9:40pm UTC](https://forum.phpvms.net/t/hiding-sidebar/4217/6 "2011-03-02T21:40:03Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![TAV1702](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tav1702/32/41_2.png) [@TAV1702](https://forum.phpvms.net/u/TAV1702)\
**Post date:** [March 2, 2011, 9:45pm UTC](https://forum.phpvms.net/t/hiding-sidebar/4217/7 "2011-03-02T21:45:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TAV1702](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tav1702/32/41_2.png) [@TAV1702](https://forum.phpvms.net/u/TAV1702)\
**Post date:** [March 2, 2011, 9:46pm UTC](https://forum.phpvms.net/t/hiding-sidebar/4217/8 "2011-03-02T21:46:23Z")

</div>

> 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.

---

<div class="post-metadata">

**Author:** ![Sascha\_DCS299](https://forum.phpvms.net/letter_avatar_proxy/v4/letter/s/ad7895/32.png) [@Sascha\_DCS299](https://forum.phpvms.net/u/Sascha_DCS299)\
**Post date:** [March 2, 2011, 9:50pm UTC](https://forum.phpvms.net/t/hiding-sidebar/4217/9 "2011-03-02T21:50:04Z")

</div>

> 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

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [March 3, 2011, 1:33am UTC](https://forum.phpvms.net/t/hiding-sidebar/4217/10 "2011-03-03T01:33:54Z")

</div>

> 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
         }
?>

```

---

<div class="post-metadata">

**Author:** ![TAV1702](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tav1702/32/41_2.png) [@TAV1702](https://forum.phpvms.net/u/TAV1702)\
**Post date:** [March 3, 2011, 10:38pm UTC](https://forum.phpvms.net/t/hiding-sidebar/4217/11 "2011-03-03T22:38:09Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![simpilot](https://forum.phpvms.net/user_avatar/forum.phpvms.net/simpilot/32/26_2.png) [@simpilot](https://forum.phpvms.net/u/simpilot)\
**Post date:** [March 4, 2011, 2:08am UTC](https://forum.phpvms.net/t/hiding-sidebar/4217/12 "2011-03-04T02:08:08Z")

</div>

Wrap the code for your sidebar inside of the if statement and it will not show when the timetable comes up.

---

<div class="post-metadata">

**Author:** ![TAV1702](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tav1702/32/41_2.png) [@TAV1702](https://forum.phpvms.net/u/TAV1702)\
**Post date:** [March 4, 2011, 2:26am UTC](https://forum.phpvms.net/t/hiding-sidebar/4217/13 "2011-03-04T02:26:23Z")

</div>

Kind of what I thought. I just wanted to be sure. I thank you much for your help Dave. As usual, +1 Rep!

---

<div class="post-metadata">

**Author:** ![TAV1702](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tav1702/32/41_2.png) [@TAV1702](https://forum.phpvms.net/u/TAV1702)\
**Post date:** [March 4, 2011, 2:41am UTC](https://forum.phpvms.net/t/hiding-sidebar/4217/14 "2011-03-04T02:41:08Z")

</div>

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.

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.

---

<div class="post-metadata">

**Author:** ![TAV1702](https://forum.phpvms.net/user_avatar/forum.phpvms.net/tav1702/32/41_2.png) [@TAV1702](https://forum.phpvms.net/u/TAV1702)\
**Post date:** [March 6, 2011, 4:53am UTC](https://forum.phpvms.net/t/hiding-sidebar/4217/15 "2011-03-06T04:53:33Z")

</div>

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.
