TinyPortal

Development => Support => Topic started by: catchpen on October 04, 2007, 08:59:53 PM

Title: Same side block panel width in forum vs frontpage
Post by: catchpen on October 04, 2007, 08:59:53 PM
Is there a way or tweak to have left or right block panels in different widths when viewing forum vs. when viewing frontpage?
I like my left panel on the front page stay kind of wide ~265px and have my forum panel narrow but on the left as well but around 160px .

Thanks, C.P.
Title: Re: Same side block panel width in forum vs frontpage
Post by: G6Cad on October 04, 2007, 09:06:01 PM
The panels are built with one action for both borum and frontpage, so as is it's not possible. I dont know if it's hard to change the code to make it like you want it  :-\
Title: Re: Same side block panel width in forum vs frontpage
Post by: catchpen on October 04, 2007, 09:16:42 PM
OK, I'm just being picky anyways ;D Thanks for the quick reply.
Title: Re: Same side block panel width in forum vs frontpage
Post by: IchBin on October 05, 2007, 02:32:26 AM
You could do it with some code. Open index.template.php and add this code before the <body> tag would be ok.
if ($context['TPoral']['is_front'] == 1){
    $leftside = 1;
}
else{
    $leftside = 0;
}


Then in your sidebar code you could find this code:
echo '<td width="' ,$context['TPortal']['leftbar_width'], '"

Change it with this:
echo '<td width="', ($leftside == 1) ? '265px' : $context['TPortal']['leftbar_width'],'"
Title: Re: Same side block panel width in forum vs frontpage
Post by: G6Cad on October 05, 2007, 06:33:59 AM
This one i just have to try, it's a good feature IMO  :D
Title: Re: Same side block panel width in forum vs frontpage
Post by: catchpen on October 05, 2007, 07:39:58 AM
Quote from: G6 on October 05, 2007, 06:33:59 AM
This one i just have to try, it's a good feature IMO  :D
Yea that's awesome - just made a TP site that much more versatile.  So the 265px for the front page is going to fixed but the left panel everywhere else will be adjustable through TP settings on the admin page? And if I undo the code mentioned above it would be back to normal?
Thanks,
C.P.
Title: Re: Same side block panel width in forum vs frontpage
Post by: IchBin on October 05, 2007, 11:12:01 PM
Did it work? It just popped in my head how to do it, so I wondered if it would work. lol
Title: Re: Same side block panel width in forum vs frontpage
Post by: catchpen on October 06, 2007, 12:12:56 AM
Not exactly.  One page page would be parser error
line - if ($context['TPortal']['is_front'] == 1){  
I would fiddle with the code and the closest I got it looked like a hybrid between my Mesh TP theme and the default. Both themes have their own index.template.php but the panel width settings stay the same when switching themes. Doesn't this mean it's getting the panel widths from a common php template? I tried just the default theme but it still wouldn't work.
BTW what's a Tporal?  :2funny:
Title: Re: Same side block panel width in forum vs frontpage
Post by: IchBin on October 06, 2007, 12:55:02 AM
Well, show the code if you want help fixing it... lol  Yes, it means you'd have to do this to each theme you want it to work in.
Title: Re: Same side block panel width in forum vs frontpage
Post by: catchpen on October 07, 2007, 08:51:35 PM
I'll probably try to tackle this in a week or so, thanks for the help.
Title: Re: Same side block panel width in forum vs frontpage
Post by: bloc on October 10, 2007, 08:08:24 AM
Quote from: catchpen on October 06, 2007, 12:12:56 AM
Not exactly.  One page page would be parser error
line - if ($context['TPortal']['is_front'] == 1){  
I would fiddle with the code and the closest I got it looked like a hybrid between my Mesh TP theme and the default. Both themes have their own index.template.php but the panel width settings stay the same when switching themes. Doesn't this mean it's getting the panel widths from a common php template? I tried just the default theme but it still wouldn't work.
BTW what's a Tporal?  :2funny:

It should get the panel width from TP itself, in Settings page.

But different panel widths for different pages..sounds like a useful function.