I have limited success with the template-specific sidebars, but I've only gotten it to work for DISPLAYING sidebars that normally are turned off.
Step One:
Because the sidebars are not created in the Main Index Template, but rather in the Header and Footer files, I had to first combine them all into on new page template file. Lets call it SpecialPage.php
Step Two:
Go into SpecialPage.php and find the code block for the sidebar you want to turn on.
Change the line that looks like:
PHP Code:
<?php if ( $bfa_ata['right_col'] == "on" ) { ?>
to:
PHP Code:
<?php if ( 1 == 1 ) { ?>
This turns on that sidebar when that template is in use.
Step Three:
The header needs to know how many columns are underneath it to display correctly. Usually it calls a function to check what sidebars are being displayed and figures it out from there. Step two just screwed up it's ability to do that. So, since you know how many columns there are underneath, just tell it.
Find:
PHP Code:
<td id="header" colspan="<?php echo $bfa_ata['cols']; ?>">
and change it to:
PHP Code:
<td id="header" colspan="X">
with X being the total number of columns turned on for pages using this template.
So...
That works.
But now
I have a problem-
I can't do the opposite-
turn OFF specific sidebars.
I tried doing exactly what I described herein, but telling them to turn off by changing the IF statement to IF 1=2. This
almost works, but not quite. It screws up layout:
When i use this hack to REPLACE one sidebar with another (usually "Right" displays, but for SpecialPage I want "Right-inner") the right inner sidebar displays, with right inner sidebar content... But with the Width of the right sidebar.
I CANNOT figure out what is causing this. It seems really weird to me.
I even tried changing the ID of the that SpecialPage sidebar, and then styling it specifically in CSS. No such luck. My browser knows that width is supposed to be X (according to Chrome's "Inspect Element" tool), but it displays as Y.
Also- if I normally only have one sidebar on, but want to turn on an additional sidebar for SpecialPage, it pushes the sidebar content out of the layout container like it doesn't have room for it.
In both of these instances, it's acting as if the center content column has a fixed width that won't expand or contract, and my right sidebars just have to deal with it.
Note- the "it works" stuff was all with the left sidebars, and the "WTF" stuff was all with the right sidebars.