TAV1702 Posted March 2, 2011 Report Share Posted March 2, 2011 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 Quote Link to comment Share on other sites More sharing options...
Sascha (DCS299) Posted March 2, 2011 Report Share Posted March 2, 2011 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? Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted March 2, 2011 Author Report Share Posted March 2, 2011 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. Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted March 2, 2011 Author Report Share Posted March 2, 2011 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. Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted March 2, 2011 Author Report Share Posted March 2, 2011 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 Quote Link to comment Share on other sites More sharing options...
Sascha (DCS299) Posted March 2, 2011 Report Share Posted March 2, 2011 (edited) 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! Edited March 2, 2011 by Sascha (DCS299) Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted March 2, 2011 Author Report Share Posted March 2, 2011 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. Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted March 2, 2011 Author Report Share Posted March 2, 2011 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. Quote Link to comment Share on other sites More sharing options...
Sascha (DCS299) Posted March 2, 2011 Report Share Posted March 2, 2011 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 Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted March 3, 2011 Administrators Report Share Posted March 3, 2011 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 } ?> 1 Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted March 3, 2011 Author Report Share Posted March 3, 2011 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. Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted March 4, 2011 Administrators Report Share Posted March 4, 2011 Wrap the code for your sidebar inside of the if statement and it will not show when the timetable comes up. Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted March 4, 2011 Author Report Share Posted March 4, 2011 Kind of what I thought. I just wanted to be sure. I thank you much for your help Dave. As usual, +1 Rep! Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted March 4, 2011 Author Report Share Posted March 4, 2011 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. Quote Link to comment Share on other sites More sharing options...
TAV1702 Posted March 6, 2011 Author Report Share Posted March 6, 2011 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.