Elxis CMS Forum

Support => General => Topic started by: xmanhattan on July 08, 2009, 17:16:12

Title: collapsing or hiding right column again
Post by: xmanhattan on July 08, 2009, 17:16:12
Hello all,

Sorry to say that I di not managed to make this work and the last time I simply had to cheat and have the browser open a new page.

Okay, first of all I am using the Okto template as my basis.  I have tried the following code in the template directory:
index.php
Code: [Select]
<?php 
//  modification to hide right column when not used
if (moscountmodules(&#39;right&#39;) > 0) { ?>

<style type="text/css">#norightcolumn {
overflow:visible;
}</style>
<?php ?> 

and I have also tried adding the following in layout.css
Code: [Select]
/* hide or collapse template's right column */
#norightcolumn {
float:right;
width:2%;
margin-left: 0 5px; /* This is the important line */
overflow:visible;
}
/* template's right column */
#rightcolumn {
float:right;
width:20%;
overflow:hidden;
margin-left:-3px;
}

but I still cannot get it to work.

I also tried putting #norightcolumn into the Page Class Suffix: of the wrapper menu item.

Can someone help me on this?

Title: Re: collapsing or hiding right column again
Post by: Farhad Sakhaei on July 08, 2009, 17:28:52
I think you want to use display: none ?
Title: Re: collapsing or hiding right column again
Post by: apkoutsou on July 08, 2009, 17:38:48
Farhad is right!

The overflow property has to do with whether the size of the div shall be expanded or not if its contents doesn't fit in it...

Here (http://www.w3schools.com/Css/pr_pos_overflow.asp) is the official manual.
Title: Re: collapsing or hiding right column again
Post by: xmanhattan on July 08, 2009, 17:43:09
Hello Farhad,

Thank you for responding.  I just tried what you wrote but it didn't work.

I then tried changing the lines in index.php as follows but that didn't work although I am not sure what I did is correct.
Code: [Select]
<?php 
//  modification to hide right column when not used
if (moscountmodules(&#39;right&#39;) > 0) { ?>

<div class = 'norightcolumn'></div>
<?php }   

Then a thought came to me regarding Okto.  It is a faux template so maybe the approach is completely wrong.
I believe that the left and center columns are considered as one.

Is this a possibility and why can't a css class be used so that it does not have to involve the index.php file?


Title: Re: collapsing or hiding right column again
Post by: apkoutsou on July 08, 2009, 17:47:49
I really haven't yet understand what is your goal  ??? Hide the right column if there are no modules set on it or something else (e.g. hide it when a button is pressed)?
Title: Re: collapsing or hiding right column again
Post by: Ivan Trebješanin on July 08, 2009, 21:02:39
I really can't understand what are you trying to do, but you have tutorial on the subject in topic here http://wiki.elxis.org/wiki/Collapsible_columns
Title: Re: collapsing or hiding right column again
Post by: xmanhattan on July 09, 2009, 10:22:33
Okay, here is a picture of what I am seeing and why I want to eliminate the "greenish" area on the right.  It might be better to say that I want the center area to be visible on top of the right area.  By the way, I do not want a button to control this css should be doing it.

I have read through the wiki and I understand what you are saying, I have even created 2 files to test it but then again, that is not a faux template.



[attachment deleted by admin]
Title: Re: collapsing or hiding right column again
Post by: Ivan Trebješanin on July 09, 2009, 12:37:23
You must modify the template css. It is using "faux columns" technique (http://www.alistapart.com/articles/fauxcolumns/)
Title: Re: collapsing or hiding right column again
Post by: ks-net on July 09, 2009, 15:47:42
Code: [Select]
<?php 
//  modification to hide right column when not used
if (moscountmodules(&#39;right&#39;) > 0) { ?>

<div class = 'norightcolumn'></div>
<?php }  

this is not enough for okto as it uses wrappers, floating divs, bgimages for columns ... you need more coding there.. you have to add rules for many elements...
wiki article is for getting a generic idea... but you need to apply it on your tpl in different way for each tpl

if you are in a harry i will give you a quick solution(the other way)... using tpl assign to pages ...
https://forum.elxis.org/index.php?topic=3200.msg20743#msg20743
go there and download the attachments with modified versions of okto... no-right/no-columns/
note that this method is sometimes preferable than collapsible columns .. especially when all our modules-content is ready and published.. it is then more quick to hide columns..


also you can use other tpls that are using this method... kebic and ivan have made some i think...

PS. i can't promise but i will try to add collapsible columns to okto... this will not be very soon...
Title: Re: collapsing or hiding right column again
Post by: xmanhattan on July 09, 2009, 18:28:09

Well, I tried what you mentioned ks-net but in Okto it still does not work.
I also changed the layout.css to include this:
Code: [Select]
/* hide or collapse template column */
.nocolumn #rightcolumn{display:none;}
.nocolumn #main-body{width:100% !important;}

and

the index.php
Code: [Select]
<?php 
//  modification to hide right column when not used
if (moscountmodules(&#39;right&#39;) > 0) { ?>

<div id="container" class="nocolumn"></div>
<?php

but that did not seem to do it.  I will continue to try and work this out.

If anyone comes up with a solution, I would appeciate seeing it.

Title: Re: collapsing or hiding right column again
Post by: ks-net on July 09, 2009, 18:42:54
actually your problem is the css


in those files above are already modified css to hide right column.....
study them to see modifications needed .. then apply the rules in php

i mention also  that bgimages if  i remember well needs modifications ... if so, look inside folders i have modify them...
that brown color at the right is a bgimage ... not of the right column but from the div below it... if you erase right column the color will still be there...

see what i mean when say you need to modify more elements?
Title: Re: collapsing or hiding right column again
Post by: xmanhattan on July 10, 2009, 11:41:30
As another thought, if I copy and change okto to a two column layout with the name layout2.css, is there a way to use that from index.php?

While I am still trying different ways to make this work....

By the way, this is the page online http://www.enosismyrneon.gr/elxis/ext/anazetese-biblion.html (http://www.enosismyrneon.gr/elxis/ext/anazetese-biblion.html)