[support] issue with forums and my template

Steve Edwards killshot91 at comcast.net
Thu Apr 24 20:00:36 UTC 2008


According to Chapter 8 of my handy-dandy 'Pro Drupal Development' book, 
$node is available in page.tpl.php (see top pf page 118).

Steve

Brett Evanson wrote:
> you can't add it to your page.tpl file because it isn't aware of 
> $node. if you are using pathauto and making all forum topics have a 
> specific prefix, you could filter on that prefix, but that would be in 
> the block visibility still. If you want to do it in the page.tpl file, 
> you could do something like this:
>
> $thenode = node_load(arg(1));
> if($thenode->type != 'forum'){
> //print sidebar
> }
>
> but that is going to cause an extra node to load on the server. not a 
> big deal on small sites, but if it gets big, you're going to want to 
> do it another way.
>
> Brett
>
> On Thu, Apr 24, 2008 at 12:24 PM, Mike Johnston 
> <shockedoctopus at gmail.com <mailto:shockedoctopus at gmail.com>> wrote:
>
>     Thanks for the help Brett. Here's what i tried adding to my
>     page.tpl.php and page-front.tpl.php (the bolded area) but it
>     doesn't seem to be working:
>
>      <div id="secondary">
>           <?php if ($sidebar_left_featured) { print "<div
>     class='sidebar-featured'>$sidebar_left_featured</div>"; } ?>
>           <?php if ($sidebar_left) { print $sidebar_left; } ?>
>           *<?php if ($node->type == 'forum') return false; ?>*
>         </div>
>         <div id="tertiary">
>           <?php if ($sidebar_right) { print $sidebar_right; } ?>
>           *<?php if ($node->type == 'forum') return false; ?>*
>         </div>
>
>
>     On Thu, Apr 24, 2008 at 12:03 PM, Brett Evanson <brettev at gmail.com
>     <mailto:brettev at gmail.com>> wrote:
>
>         probably in the block visibility for whatever block you don't
>         want to show.
>
>         Brett
>
>
>
>         On Thu, Apr 24, 2008 at 11:38 AM, Mike Johnston
>         <shockedoctopus at gmail.com <mailto:shockedoctopus at gmail.com>>
>         wrote:
>
>             Dumb question time (i'm bad with php).. does this go
>             somewhere in my page.tpl.php or template.php?
>
>
>             On Thu, Apr 24, 2008 at 10:29 AM, Brett Evanson
>             <brettev at gmail.com <mailto:brettev at gmail.com>> wrote:
>
>                 You could put some logic in your template file to
>                 check if the current page is the forum, or you could
>                 put logic in the blocks to not show on forum pages.
>                 Should be something like
>                 if($node->type == 'forum') return false;
>
>                 Brett
>
>                 On Thu, Apr 24, 2008 at 10:18 AM, Mike Johnston
>                 <shockedoctopus at gmail.com
>                 <mailto:shockedoctopus at gmail.com>> wrote:
>
>                     I'm using the drupal efficient theme located here:
>                     themesnap.com <http://themesnap.com> and whenever
>                     i try to go to my forums page, it crams it in the
>                     far left column but leaves the two right sidebars
>                     on. Is there a way to remove the sidebars from
>                     this particular view only so that the forums
>                     display correctly? You can see what I mean here:
>                     http://shockedoctopus.com/phpbbforum/
>
>                     --
>                     [ Drupal support list | http://lists.drupal.org/ ]
>
>
>
>
>                 -- 
>                 Brett Evanson
>                 --
>                 [ Drupal support list | http://lists.drupal.org/ ]
>
>
>
>             --
>             [ Drupal support list | http://lists.drupal.org/ ]
>
>
>
>
>         -- 
>         Brett Evanson
>
>         --
>         [ Drupal support list | http://lists.drupal.org/ ]
>
>
>
>     --
>     [ Drupal support list | http://lists.drupal.org/ ]
>
>
>
>
> -- 
> Brett Evanson 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20080424/cb89c70d/attachment.htm 


More information about the support mailing list