If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1
  1. #1
    Senior Member Trico's Avatar
    Join Date
    Feb 2004
    Nottingham, UK
    Member #

    I'm building a Drupal website with v5.7 that you can view using this link:

    [short] I'm looking for some help that uses PHP as a possible solution to the below problem. [/]

    My theme is designed with a left sidebar and a main content region. The full height of each column is simulated using a faux columns technique. On the /forum and /gigs pages I want to be able to remove the left-sidebar completely so the main content-region has room to expand the full width potential of the layout.

    I've used a PHP if statement around my sidebar so when I remove the blocks assigned to it, it collapses away/disappears as desired, however the main content won't expand to take up the extra space.

    If I use width: auto; in my CSS on the content-region it solves my problem for the specified pages (/forum,/gigs), however it spills underneath the left sidebar on all the other remaining pages (/node for example) becasue there isn't actually a true column moulding the content flow.

    Building another theme file for these two pages seems overkill so I'm thinking a small bit of PHP could be used to add an extra CSS class on the content-region <div> that overrides the fixed width for these pages only. My PHP knowledge is extremely basic; I like a challenge, but this is beyond my skill/technical level.

    Can anyone help me with this?

    I came up with the below code, which sort of communicates the idea, but syntax wise is probably gibberish.

    <?php if page = forum,gigs echo "class="expand" Else echo "" ?>
    And I need to apply it in this context: <div class="content-region"> BECOMES <div class="content-region expand">

    .content-region { width: 560px; } becomes overidden with .expand { width: auto; } on /gigs* and /forum* pages only.

    Kind regards,



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 09:58 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: