If I were a css adept, I'm sure these would not be worthy of the issue queu, but...could anyone advise on quick hacks (ie, something I can drop into the _custom folder) to achive the following:

1. Slide the site slogan over so it sits nicely aligned left with the site name

2. Ask the user block divs to valign their contents to "top"

3. Explain where the site slogan is supposed to appear? (yes, it is set "on" and a value is entered)

thanks indeed!

CommentFileSizeAuthor
#4 user1234.jpg39.48 KBgeorge.g
alignment.png65.92 KBboabjohn
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Florian’s picture

Thanks for the findings. the IE6 site slogan alignment if no logo is present will be corrected in the next release. I don't understand no.2, please explain.

To slide site-slogan use this lines in custom_style.css:

#site-slogan {
  padding-left: 100px; /*here is your value*/
}
boabjohn’s picture

Thanks for the fast help with the alignment (1), and my browser in the screenshot is FFox3.5 on Windows Vista.

(2) My apologies for a poor description. I'm referring to the regions labeled User1...8.
I have various content in new blocks for those regions. Mostly just text, or an embedded slideshow.
The vertical alignment for the block's cell is centre, so the block titles are not sitting on the same baseline running left-right. Is it possible to "valign = top"?

(3) Slogan? Is that only for the page display...ie, not visible in the page layout, only in the browser's page information display?

Thanks indeed.

Florian’s picture

(2) Use this code in /_custom/custom-style.css :

#section1 td.section, #section2 td.section {
	vertical-align: top;
}

.. I will add this by default in the next release.

(3) Slogan, if enabled, appears on all pages.

george.g’s picture

FileSize
39.48 KB

I attached a screenshot with a similar problem. How can I align the pictures with the titles and how can I make all the user1,2,3,4 blocks equal? Now the first one is longer then the others. I would like all the content from those blocks to be equally distributed. Could you help me?

Florian’s picture

You have to ad some lines to _custom/custom-style.css. For example, if you have 4 blocks (user 1-4) and only 2 blocks (user 5-8) ad this:

#section1 td.section {
  width: 25%;
}
#section2 td.section {
  width: 50%;
}
george.g’s picture

Thanks

george.g’s picture

Just one more thing: how can I make the custom.css to have priority over te sky.css (or any other css file)? What I want to do is this: change the default color of H2 tags and the colors of the menu items, but even if I have the proper code in the custom.css, the theme still loads first the sky.css file.

Florian’s picture

Ad !important to your css, like:

h2 {
  color: #dedede !important;
}
george.g’s picture

Thanks, it worked for the H2 tags but for the nav-menu links it didn't. This is the code that I want to include in custom.css:

#navlist.links a, #navlinks ul li a {
	border: 1px solid #2f71a2;
	border-bottom: none;
	padding: 5px 24px;
	background-color: #3A8CD0 !important;
}
#navlist li a:hover, #navlinks ul li a:hover {
	color: #fff !important;
	background-color: #2f71a2 !important;
}

The problem is that in sky.css this code (background-color: #2f71a2 !important;) already has the !important tag and it doesn't get overwrite by the custom.css file.

Florian’s picture

I think it may be better to modify sky.css at this point.

Turkish Delight’s picture

In response to comment 5, what must we do if we have different column widths (due to more or less of user blocks being used) on different pages?

Example: I have on my frontpage Users 5-8 all used. However, according to your custom-style.css modifications, the widths would stay distributed to 25% not 33.3% if I removed one block.
I recall the Salamander/Ability themes with this feature of equal distribution upon removal; anyone have a hack for this theme?

Link to Ability theme: http://drupal.org/project/ability

Florian’s picture

I know well ability because it is a full copy of Salamander theme, which is also designed by me :)

0 Point user regions behave proportionally with the blocks' width, the same as Salamanderskins , Salamander and it's copy, Ability. If you would like to have equal region width across the user regions it is the only method that came to my mind.

Turkish Delight’s picture

In response to comment 12, I wanted to drop this code in if any of you want to have an 'auto-distribution' (50%/2 blocks, 33.3%/3 blocks and 25%/4 blocks) for your userblocks. I'm going to look into making this an option on the theme page similar to the fixed v. variable layout options (standard v. auto-distribution). Thanks to Florian to writing essentially this in Salamander/Ability.

In layout.css (in the css folder), post underneath

table.sections { 
        width: 100%
        padding: 0;
}
td.section.width49 {
	width: 50%;
}

td.section.width33 {
	width: 33%;
}

td.section.width24 {
	width: 25%;
}

In page.tpl.php, (in the case of user blocks 1-4) replace

<?php if ($user1 or $user2 or $user3 or $user4): ?>
  <div id="section1" class="clear-block">
  <table class="sections" cellspacing="0" cellpadding="0">
    <tr>
    <?php if ($user1): ?><td class="section"><?php print $user1; ?></td><?php endif; ?>
    <?php if ($user2): ?><td class="section <?php if ($user1): ?>divider<?php endif; ?>"><?php print $user2; ?></td><?php endif; ?>
    <?php if ($user3): ?><td class="section <?php if ($user1 or $user2): ?>divider<?php endif; ?>"><?php print $user3; ?></td><?php endif; ?>
    <?php if ($user4): ?><td class="section <?php if ($user1 or $user2 or $user3): ?>divider<?php endif; ?>"><?php print $user4; ?></td><?php endif; ?>
    </tr>
  </table>
  </div>  <!-- /section1 -->
<?php endif; ?>

With this:

<?php
        $section1count = 0;
        $user1count = 0;
        $user2count = 0;
        $user3count = 0;
        $user4count = 0;

        if ($user1)
        {
          $section1count++;
          $user1count++;
        }

        if ($user2)
        {
          $section1count++;
          $user2count++;
        }

        if ($user3)
        {
          $section1count++;
          $user3count++;
        }

        if ($user4)
        {
          $section1count++;
          $user4count++;
        }
?>

<?php if ($section1count): ?>
  <?php $section1width = 'width' . floor(99 / $section1count); ?>
  <?php $block2div = ($user2count and $user1count) ? " divider" : ""; ?>
  <?php $block3div = ($user3count and ($user1count or $user2count)) ? " divider" : ""; ?>
  <?php $block4div = ($user4count and ($user1count or $user2count or $user3count)) ? " divider" : ""; ?>
  <div id="section1" class="clear-block">
  <table class="sections" cellspacing="0" cellpadding="0">
    <tr>
    <?php if ($user1): ?><td class="section <?php echo $section1width ?>"><?php print $user1; ?></td><?php endif; ?>
    <?php if ($user2): ?><td class="section <?php echo $section1width . $block2div; ?>"><?php print $user2; ?></td><?php endif; ?>
    <?php if ($user3): ?><td class="section <?php echo $section1width . $block3div; ?>"><?php print $user3; ?></td><?php endif; ?>
    <?php if ($user4): ?><td class="section <?php echo $section1width . $block4div; ?>"><?php print $user4; ?></td><?php endif; ?>
    </tr>
  </table>
  </div>  <!-- /section1 -->
<?php endif; ?>
Turkish Delight’s picture

Also want to add a piece of misleading code that does not display the borders just in case anyone runs into the issue.

<?php
	$section1count = 0;
	$user1count = 0;
	$user2count = 0;
	$user3count = 0;
	$user4count = 0;
	
	if ($user1)
	{
	  $section1count++;
	  $user1count++;
	}
	
	if ($user2)
	{
	  $section1count++;
	  $user2count++;
	}
	
	if ($user3)
	{
	  $section1count++;
	  $user3count++;
	}
	
	if ($user4)
	{
	  $section1count++;
	  $user4count++;
	}
?>

<?php if ($section1count): ?>
  <?php $section1width = 'width' . floor(99 / $section1count); ?>

  <div id="section1" class="clear-block">
  <table class="sections" cellspacing="0" cellpadding="0">
    <tr>
    <?php if ($user1): ?><td class="section <?php echo $section1width ?>"><?php print $user1; ?></td><?php endif; ?>
    <?php if ($user2): ?><td class="section <?php echo $section1width ?><?php if ($user1): ?>divider<?php endif; ?>"><?php print $user2; ?></td><?php endif; ?>
    <?php if ($user3): ?><td class="section <?php echo $section1width ?><?php if ($user1 or $user2): ?>divider<?php endif; ?>"><?php print $user3; ?></td><?php endif; ?>
    <?php if ($user4): ?><td class="section <?php echo $section1width ?><?php if ($user1 or $user2 or $user3): ?>divider<?php endif; ?>"><?php print $user4; ?></td><?php endif; ?>
    </tr>
  </table>
  </div>  <!-- /section1 -->
<?php endif; ?>

echo $section1width disrupts the flow here, which is why instantiating $block2div, $block3div and $block4div (in comment 13) is necessary.

Florian’s picture

Thanks. I will add this as an option in the next release of 0 Point.

asinnema’s picture

Boabjohn, use firefox and the addon firebug. I am not really a firefox user (Operagirl here) but it really helps when you want to tweak CSS settings.

Florian’s picture

Status: Active » Fixed

Fixed in releases 6.x-1.9 and 6.x-2.2

Florian’s picture

Status: Fixed » Closed (fixed)
timgray75’s picture

Version: 6.x-1.7 » 6.x-1.20
Status: Closed (fixed) » Active

Following on from the above workaround regarding column widths in user blocks 1-4, I want to go the other way and make all the user blocks fixed width. For blocks that I have created myself this isn't a problem as I can use a

tag to set the width, and this works when I have four user-created blocks on the page.

However there are some blocks which are created by the system (Language Switcher / Active Forum Topics / Who's New etc) where I can't set the width, and because sometimes their content is dynamic, they vary in width, which means my fixed-width blocks can get wider to compensate (because "width" is setting only the minimum width for the block).

I've tried adding lines into custom_css to set the width of the system-generated blocks, but had to guess at what those blocks are called, and I don't know whether there is something overriding custom_css anyway.

All four user blocks are used on every page.

So iis there a way of fixing the width of the blocks?

Florian’s picture

Status: Active » Fixed

The issues was fixed in versions 6.x-1.24 and 7.x-1.10.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.