Posted by gro on February 10, 2011 at 3:36am
I'd like to be able to remove the site name and slogan from the Branding Zone but am totally clueless on how I can do that.
So far I've attempted making them inactive using General Theme settings and the specific sub-theme that I'm using, which works but also removes them from the window title bar.
Is it possible to remove them from the Branding Zone but keep them in the window title bar?
Thanks for any help you can give me with this, it's the one stumbling block I've encountered with Omega, everything else has been really intuitive. Thanks for developing a great product.
Comments
My tactic....
This IS a common item needed, and in my own experience, this would happen, when you need to put in a large horizontal logo or header image in that "logo" area....
Yes, unsetting the title and slogan in the generic theme settings does have some pretty painful side effects, BUT.... there is a way that I use on almost every situation....
A.) The site title and slogan are very important to have on the page for SEO value
B.) BUT You don't want them to be visible to the end user
C.) You have some very pretty logo/header image you want to insert there instead for users to see
My approach is using some simple CSS for this...
#region-branding h1, #region-branding h2 {display: none;
}
OR
#region-branding h1, #region-branding h2 {text-indent: -9999em;
}
The first method above will remove the site title by simply using the CSS display none to hide it from the end user... BUT if someone was to for any reason be viewing the site with a browser that did not display CSS, then it WOULD display, and actually we would want as our fancy logo/header image may not show if it was placed via CSS rather than the simple upload logo in the theme settings.
The second method simply moves the title completely off the page to the left where it will never be visible. But depending on CSS, you can have some spacing issues because the header "is" really still there and visible...
I use these two methods 99% of the time depending on my situation.
I will turn off the logo display, then set the site title h2 or h1 (depending on the page it's on) and make the a tag inside that header have the background image of the logo I want to display, and then move the text off screen. I think this is the way (i forget) that I did it on himerus.com...
There are other ways, but I recommend for this (assuming my short list above is correct in assumptions) simply using CSS to "hide" the title and slogan, but leaving them on the page so that Drupal can use them, so that search engines still read them, etc.
Jake Strawn (@himerus)
ThemeGeeks | Development Geeks
Omega - 960.gs
I second that opioion...
the second method that Jake proposes is the one I always use and--for SEO reasons, as Jake suggested--is probably the best. Using the negative text indent effectively removes the title (or whatever) from view, but leaves it on the "page" for search engines to find, exactly where they expect it to be.
win/win
Roger
_________________
Art has gone to the dogs
GoodeGallery.com
Thanks, I'm using this method
This is exactly the same issue I just ran into. Your trick works perfectly, thanks!
Oh, and one other method...
I forgot to mention the one "real" non CSS way to get rid of these items would be .... (sorry I was in a hurry typing like mad)
If you look in the core omega directory (/sites/(all)/themes/omega/omega/templates) you should see a region--branding.tpl.php
The contents of that file are:
<div class="<?php print $classes; ?>" <?php print $attributes; ?>><div class="branding-data">
<?php if(isset($linked_logo_img)): ?>
<div class="logo-img">
<?php print $linked_logo_img; ?>
</div>
<?php endif; ?>
<div class="site-name-slogan">
<?php if ($is_front): ?>
<h1 class="site-title"><?php print $linked_site_name; ?></h1>
<?php else: ?>
<h2 class="site-title"><?php print $linked_site_name; ?></h2>
<?php endif; ?>
<?php if(isset($slogan)): ?>
<h6 class="site-slogan"><?php print $slogan; ?></h6>
<?php endif; ?>
</div>
</div>
</div>
So you could also copy that file to your own subtheme in the templates folder (then remember to clear caches) and take them out by simply removing them all together.
But this is not the way I would do it as you lose the SEO value of those items at the very top of your page.... But in relations to which is the "best" way.... to each his own... :)
Jake Strawn (@himerus)
ThemeGeeks | Development Geeks
Omega - 960.gs
Nice
I'll definitely go with the second CSS option because SEO is important to me.
Thanks for such a prompt response and the reasoning for each method, it's a huge help to me.
Keep up the great work.
Adding the drupal core class
Adding the drupal core class "element-invisible" works too.
and you could do .hidden {
and you could do
.hidden {position: absolute;
clip: rect(0px 0px 0px 0px);
}
http://designfestival.com/when-and-how-to-visually-hide-content/