How can we have a left sidbar in this Theme?

sa3er - March 9, 2007 - 13:00
Project:Internet Services (with 2nd Edition)
Version:5.x-1.1
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Thanks for your email reply.
As you requested I will post the matter as an issue here.

Here is my website with Internet Services theme applied with lots of customization though:
www.erteash.com

Yes, it's in persian(farsi) which is a right-to-left language and I went all the way of making theme RTL compliant. But I want know how can I add a "left sidebar" in Internet Services theme. I set the ID #page width to 100% so I need a left side bar while there are lot of information/ads/etc in right sidebar which made it a little bad looking. It also doesnt look much pro. There're some other obvious problem in theme which caused by my RTL conversion. :(

Where/Which files should I edit to add "left sidebar" contents. I need your help.

Thanks in advance

Internet Services Theme Rockz!

#1

mohammed76 - March 15, 2007 - 16:27

hi.

this theme has already been converted to a bidi theme for version 4.7 and will shortly be done for 5.0, check
this page for more info.

#2

hswong3i - March 16, 2007 - 07:06

this support request include 2 sections: left sidebar supporting, and RTL handling

left sidebar supporting

i am currently working on it, but facing some problem. as this theme is originally a fixed width 2-column theme, it is only suitable to have 2 column only under 800x600. the feature of no sidebar is currently added to this theme as add-on feature (so you can have page without sidebar, and display in 100% width).

i can further more adding the support of left sidebar to this theme (is not too difficult...), but this will be confusing for new user: the theme will seems to be support 3-column, which is not suitable under 800x600. although user can active rather left or right sidebar ONLY at once, but they are also able to active BOTH.

maybe a sub-theme is required for adding this feature: original version will support for main + right, where sub-theme will support for left + main. i have no final decision right now. please feel free to comment with this.

RTL supporting

this is not a simple request for me: as i am using LTL. please feel free to submit patch or comment about the implementation.

BTW, i don't really support the FORK (http://drupal.org/project/internet_services_rtl) of theme (please refer to http://drupal.org/node/128099). it will increase the difficulty of theme maintenance: unless you will hope to manually handle the bug fix/feature request/support request under the new theme. if this SHOULD BE the feature within this theme, people is HOPING for it, and some PATCH or SUGGESTION are submitting to this theme's issue, i will try my best to handle it.

as this theme is OSS, you can do FORK whenever you hope to do so, but the maintenance of FORK version will not be my business ;-)

#3

sa3er - May 7, 2007 - 13:51

Thanks for explanations,

Maybe I'm wrong but most of people are now running in 1024*768 and as you consider, in sites Yahoo, Micorosft, etc ... are in 1024 mode.

Would you please give some notes how to add the addiotional left/right side bar. I've tried to do it but no luck. Nothing was going into its place.

I really need to make this theme a 3-column mode.

#
LeftSidebar-Content-RightSideBar
#

Thanks in advance.

#4

hswong3i - May 11, 2007 - 03:50

it is fine to have 1024x768, 3-column or even RTL mode within this theme (i am able to handle such coding), but the most difficulty is how to keep the overall design consistence: we have a fixed width search box under 2nd menu, which limit the flexibility.

on the other hand, i am not going to create a new theme: it is a re-implementation of original design (http://www.solucija.com/templates/demo/Internet_Services/). so it is always welcome if improvement is not layout related, e.g. w/o right sidebar, search bar, etc. and that's why i add such feature with no question.

my note is: design, design, and design. the revamp is design driven, and it will require for yours suggestion. after we have the new layout design, all comes simple. first try to re-design the theme in image format (jpg/png/gif), post in here, and let's brain storm about how to implement it ;-)

#5

sa3er - May 13, 2007 - 08:18

Edison,
Thanks for your reply,

Well, design, design, and design is what I'm currently doing. As you consider, the theme face is no more like Internet Services and some kind of high level customization is done. I don't need theme based search field and instead would perfer to have it on sidebars. So no problem to me what is going to happen for it.

As I said earlier, your theme is greatly created and very easy to handle/edit. But when it gets to PHP coding and proffesional parts of CSS... I'm really confused. I've asked some friends about it and they all told me, the only one who could help is you (theme creator).

I've created the attached image with Photoshop. That's what I like my theme to look. I've tried a lot but no way. Don't know what is the next to do. Brain is locked :(

AttachmentSize
NEWTHEME.jpg 155.86 KB

#6

hswong3i - May 13, 2007 - 17:39

as your request is not a hope of feature add to main stream(but a customization...), this reply will not become a official hack. on the other hand, i just provide the below codes without any checking, please use them in your own risk ;P

first we need to hack template.php as, to add new region to the theme:

...
function internet_services_regions() {
  return array(
    'left' => t('left sidebar'),
    'right' => t('right sidebar'),
    'content' => t('content'),
    'header' => t('header'),
    'footer' => t('footer'),
  );
}

then hack the page.tpl.php to "display" such new region. i try to keep the new w/o sidebar feature(without debug):
...
  <div id="content"><!-- begin content -->
    <?php if ($sidebar_left) { ?>
      <div id="sidebar-left"><!-- begin sidebar-left -->
        <?php print $sidebar_left ?>
      </div><!-- end sidebar-left -->
    <?php } ?>
    <?php if ($sidebar_left || $sidebar_right) { ?><div id="main"><!-- begin main --><?php } ?>
      <?php if ($mission) { ?>
        <div id="mission">
          <h2 class="title"><?php print t('Mission') ?></h2>
          <div class="content"><?php print $mission ?></div>
        </div>
      <?php } ?>
      <?php print $breadcrumb ?>
      <?php if ($title) { ?><h1 class="title"><?php print $title ?></h1><?php } ?>
      <div class="tabs"><?php print $tabs ?></div>
      <?php print $help ?>
      <?php print $messages ?>
      <?php print $content; ?>
    <?php if ($sidebar_left || $sidebar_right) { ?></div><!-- end main --><?php } ?>
    <?php if ($sidebar_right) { ?>
      <div id="sidebar-right"><!-- begin sidebar-right -->
        <?php print $sidebar_right ?>
      </div><!-- end sidebar-right -->
    <?php } ?>
  </div><!-- end content -->
...

finally, edit style.css, clone all those code for #sidebar-right as #sidebar-left, and customize them:
...
#content #sidebar-left {
  float: right;
  width: 34.5%;
  margin: 0 0 10px 0;
}
#content #sidebar-left.block {
  margin: 0 0 3px 0;
  padding: 0;
}
...

as you know that, after adding the left sidebar the theme should no longer keep on 800x600, and you also need to take care about the styling of your new region. you SHOULD BE THE ONE who handle them within your customized style.css, and sorry that i may not give a hand about it, as i am toooooooo lazy ;P

#7

sa3er - May 15, 2007 - 12:58

Wow... Thanks for you help, Edison!

It finally worked! However as you said it needed some new style modifications and still needs some more.

There's only one thing remained which made me to back to previous theme:
When i apply newly edited theme The #primary navigation bar is gone. I couldn't even find it in HTML source code of mainpage. Do you know what happend to it or where it's gone? Any idea?

The screenshot is attached. (It's real one this time :D)

AttachmentSize
Internet_Services3Column.jpg 111.8 KB

#8

sa3er - May 15, 2007 - 13:01

Sorry I forgot,
here goes the new CSS:
http://www.erteash.com/themes/erteash/style.css

#9

hswong3i - May 16, 2007 - 03:18

let's have a look about the code in page.tpl.php:

...
  </div><!-- end header -->
  <?php if (isset($primary_links)) { ?><div id="primary"><?php print theme('primary', $primary_links) ?></div><?php } ?>
  <?php print $search_box ?>
  <div id="content"><!-- begin content -->
...

as you see that the previous hack didn't touch this section. the most important point is <?php if (isset($primary_links)) { ?>. so the question is: do you really have such variable active during page generation?

try to add something like <?php print_r($primary_links) ?> within page.tpl.php and see the printed result:

  • if it is unset, check your drupal setting to see if the primary/secondary menu is setup correctly.
  • if it is set but not exists within generated HTML source code, check did you damage some other code/section.
  • if it is set and exists within generated HTML, check CSS to see if it is override by some other tags.

good luck ;-)

#10

sa3er - June 5, 2007 - 18:10
Status:active» closed

Thanks a milion.

You RULE!

#11

hswong3i - June 6, 2007 - 02:46
Status:closed» fixed

#12

Anonymous - June 20, 2007 - 02:49
Status:fixed» closed

#13

ravisagar - August 31, 2008 - 15:37
Status:closed» active

I was able to create left sidebar using the process explained above. check the site here http://www.ggsipu.info

I am facing two problems.
1. Right Sidebar appear below the content in IE. Works fine in Firefox.
2. Whenever I make changes in the style.css the changes are not updated. I have to refresh mulitple times.

#14

hswong3i - August 31, 2008 - 16:42
Status:active» closed

@ravisagar: please file for a new issue and let this go :D

 
 

Drupal is a registered trademark of Dries Buytaert.