Why H1 tag not recognized in logo image?

Discuss Search Engine Optimization in relation to Joomla!. This forum will also have discussions on SEF/SEO Joomla! extensions.

Moderator: General Support Moderators

nic2009
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Mar 19, 2009 11:51 am

Why H1 tag not recognized in logo image?

Post by nic2009 » Mon Jan 16, 2012 11:53 am

I have following code:

<?php if ($this->params->get('logoType')=='image'): ?>
<div id="logo">
<h1><a title="Fkk und Saunaclubs in Deutschland, Österreich und der Schweiz" href="index.php">
<img title="FKK und Saunaclubs in Deutschland, Österreich und der Schweiz" alt="FKK und Saunaclubs in Deutschland, Österreich und der Schweiz" src="<?php echo $LiveSiteUrl ?>templates/<?php echo $this->template?>/images/logo.png" alt="FKK und Saunaclubs in Deutschland, Österreich und der Schweiz"/>
</a></h1>
</div>
<?php else:
$logoText = (trim($this->params->get('logoType-text-logoText'))=='') ? $config->sitename : $this->params->get('logoType-text-logoText');
$sloganText = (trim($this->params->get('logoType-text-sloganText'))=='') ? JText::_('SITE SLOGAN') : $this->params->get('logoType-text-sloganText');?>
<div id="logo-text">
<h1><a href="index.php" title="<?php echo $siteName; ?>"><span><?php echo $logoText; ?></span></a></h1>
<p class="site-slogan"><?php echo $sloganText;?></p>
</div>
<?php endif; ?>

and when checking the alt tags it recognizes an alt tag, but just '...' instead of 'Fkk und Saunaclubs in Deutschland, Österreich und der Schweiz'. What is wrong with my code?

Thanks for your help.

User avatar
tamnl
I've been banned!
Posts: 237
Joined: Wed Jan 11, 2012 8:08 am
Contact:

Re: Why H1 tag not recognized in logo image?

Post by tamnl » Tue Jan 17, 2012 5:02 am

Why do you use some SEO tools to add the H1 tag for logo image? It's better and you don't need to worry about the code. I'm not good at coding but the first paragraph of your code:
<div id="logo">
You should change to :
<h1 class="logo">

I found another topic related to your question. You can see the code in http://forum.joomla.org/viewtopic.php?p=2631901

nic2009
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Mar 19, 2009 11:51 am

Re: Why H1 tag not recognized in logo image?

Post by nic2009 » Tue Jan 17, 2012 6:11 am

Thanks a lot, will take a look at it.

What SEO tools do you suggest?

nic2009
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Mar 19, 2009 11:51 am

Re: Why H1 tag not recognized in logo image?

Post by nic2009 » Tue Jan 17, 2012 7:07 am

Ok, again...

Here the code:

<?php if ($this->params->get('logoType')=='image'): ?>
<div id="logo">
<a title="Fkk und Saunaclubs in Deutschland, Österreich und der Schweiz" href="index.php">
<img title="FKK und Saunaclubs in Deutschland, Österreich und der Schweiz" alt="FKK und Saunaclubs in Deutschland, Österreich und der Schweiz" src="<?php echo $LiveSiteUrl ?>templates/<?php echo $this->template?>/images/logo.png" alt="FKK und Saunaclubs in Deutschland, Österreich und der Schweiz"/></a>
</div>
<?php else:
$logoText = (trim($this->params->get('logoType-text-logoText'))=='') ? $config->sitename : $this->params->get('logoType-text-logoText');
$sloganText = (trim($this->params->get('logoType-text-sloganText'))=='') ? JText::_('SITE SLOGAN') : $this->params->get('logoType-text-sloganText');?>
<div id="logo-text">
<h1><a href="index.php" title="<?php echo $siteName; ?>"><span><?php echo $logoText; ?></span></a></h1>
<p class="site-slogan"><?php echo $sloganText;?></p>
</div>
<?php endif; ?>

Where to place my h1 tag in this code, so that my logo titel is h1.

Thanks for your help.

nic2009
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Mar 19, 2009 11:51 am

Re: Why H1 tag not recognized in logo image?

Post by nic2009 » Wed Jan 18, 2012 4:44 am

Still waiting for a reply...

Thanks.

User avatar
tamnl
I've been banned!
Posts: 237
Joined: Wed Jan 11, 2012 8:08 am
Contact:

Re: Why H1 tag not recognized in logo image?

Post by tamnl » Wed Jan 18, 2012 5:08 am

Sorry Nic, did you read the topic that I searched for you. You can use JFactory and copy the code as in topic http://forum.joomla.org/viewtopic.php?p=2631901?. Maybe it works. :( I used JSN templates so it automatically add my slogan as H1 tag. I see the code in that topic and the code in yours, I think you can put like this.

<?php if ($this->params->get('logoType')=='image'): ?>
<h1 class="logo">
<a title="Fkk und Saunaclubs in Deutschland, Österreich und der Schweiz" href="index.php">
<img title="FKK und Saunaclubs in Deutschland, Österreich und der Schweiz" alt="FKK und Saunaclubs in Deutschland, Österreich und der Schweiz" src="<?php echo $LiveSiteUrl ?>templates/<?php echo $this->template?>/images/logo.png" alt="FKK und Saunaclubs in Deutschland, Österreich und der Schweiz"/></a>
</h1>
<?php else:
$logoText = (trim($this->params->get('logoType-text-logoText'))=='') ? $config->sitename : $this->params->get('logoType-text-logoText');
$sloganText = (trim($this->params->get('logoType-text-sloganText'))=='') ? JText::_('SITE SLOGAN') : $this->params->get('logoType-text-sloganText');?>
<div class="logo-text">
<a href="index.php" title="<?php echo $siteName; ?>"><span><?php echo $logoText; ?></span></a>
<p class="site-slogan"><?php echo $sloganText;?></p>
</div>
<?php endif; ?>

nic2009
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Mar 19, 2009 11:51 am

Re: Why H1 tag not recognized in logo image?

Post by nic2009 » Wed Jan 18, 2012 7:00 am

I tried your suggestion already... and it shows that there is a h1 tag, but it doesn't display the text of the tag and shows following error message when checking:

There's something wrong with this H1 tag, is it an image?

And yes, it is an image. So what can I do? or is there any other method to place a h1 tag on the top of my page without being visible?

Thanks for your help.

nic2009
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Mar 19, 2009 11:51 am

Re: Why H1 tag not recognized in logo image?

Post by nic2009 » Wed Jan 18, 2012 8:37 am

I mean, even it is an image, it should be possible to give the title of the image a h1 tag, or...

User avatar
Harvey51
Joomla! Explorer
Joomla! Explorer
Posts: 300
Joined: Tue Feb 23, 2010 8:16 pm
Location: Morecambe UK
Contact:

Re: Why H1 tag not recognized in logo image?

Post by Harvey51 » Thu Jan 19, 2012 11:01 pm

From your original post,

You don't need to set an alt tag on a background image, it's a CSS item and not a html item.

The original code looks correct, but everything is within < > tags, there's no text for a h1.

Add h1 anchor text and then add this CSS to your CSS file:

#logo h1 a {
display: block;
text-indent: -5000px;
text-decoration: none;
}

This will give the logo a h1 but it wont display.
Joomla Expert http://http://urlofseo.com/joomla-support-service Expert Joomla Development and Support
Joomla SEO http://urlofseo.com small and medium sized enterprises.

nic2009
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Mar 19, 2009 11:51 am

Re: Why H1 tag not recognized in logo image?

Post by nic2009 » Fri Jan 20, 2012 2:36 am

Ok, we are coming closer... ;-)
I placed the CSS code in my CSS file and also placed a h1 tag in the index.html (see below) and it shows that there is a h1 tag in the 'h tag checker':

<!-- ///////////////////////////////////////////////////////// START LOGO /////////////////////////////// -->
<?php if ($this->params->get('logoType')=='image'): ?>
<div id="logo">
<a title="Fkk und Saunaclubs in Deutschland, Österreich und der Schweiz" href="index.php"><h1>Fkk und Saunaclubs in Deutschland, Österreich und der Schweiz></h1>
<img title="FKK und Saunaclubs in Deutschland, Österreich und der Schweiz" alt="FKK und Saunaclubs in Deutschland, Österreich und der Schweiz" src="<?php echo $LiveSiteUrl ?>templates/<?php echo $this->template?>/images/logo.png" alt="FKK und Saunaclubs in Deutschland, Österreich und der Schweiz"/></a>
</div>
<?php else:
$logoText = (trim($this->params->get('logoType-text-logoText'))=='') ? $config->sitename : $this->params->get('logoType-text-logoText');
$sloganText = (trim($this->params->get('logoType-text-sloganText'))=='') ? JText::_('SITE SLOGAN') : $this->params->get('logoType-text-sloganText');?>
<div id="logo-text">
<h1><a href="index.php" title="<?php echo $siteName; ?>"><span><?php echo $logoText; ?></span></a></h1>
<p class="site-slogan"><?php echo $sloganText;?></p>
</div>
<?php endif; ?>
<!-- ///////////////////////////////////////////////////////// END LOGO /////////////////////////////// -->

However, now my logo on the site has moved down and is covering part of my site menu. Is there a chance that you can tell me how exactly to modify my logo html and where to place the h1 tags. Just copy the logo html and place the h1 tags on the right place in the original html code (see first post), so I can just copy and paste it. That would be a great help.
Thanks a lot for your support and sorry for my bad knowledge about coding.
Last edited by nic2009 on Fri Jan 20, 2012 7:46 am, edited 1 time in total.

nic2009
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Mar 19, 2009 11:51 am

Re: Why H1 tag not recognized in logo image?

Post by nic2009 » Fri Jan 20, 2012 3:18 am

I just saw, that it shows the h1 tag text over the logo, that is why it moved down. Please advice how to hide it, so the logo is placed right again. Thanks.

User avatar
Harvey51
Joomla! Explorer
Joomla! Explorer
Posts: 300
Joined: Tue Feb 23, 2010 8:16 pm
Location: Morecambe UK
Contact:

Re: Why H1 tag not recognized in logo image?

Post by Harvey51 » Fri Jan 20, 2012 12:50 pm

nic2009,

Can you supply a URL for the site.

If it's the bike and sleep site I'm not seeing the problem.
Joomla Expert http://http://urlofseo.com/joomla-support-service Expert Joomla Development and Support
Joomla SEO http://urlofseo.com small and medium sized enterprises.

nic2009
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Mar 19, 2009 11:51 am

Re: Why H1 tag not recognized in logo image?

Post by nic2009 » Fri Jan 20, 2012 4:28 pm

No, its http://www.saunaclub.info

Thanks for having a look. I have now the standard code where no h1 tag is included.

User avatar
Harvey51
Joomla! Explorer
Joomla! Explorer
Posts: 300
Joined: Tue Feb 23, 2010 8:16 pm
Location: Morecambe UK
Contact:

Re: Why H1 tag not recognized in logo image?

Post by Harvey51 » Fri Jan 20, 2012 10:41 pm

We can easily fix this for you, on Monday morning can you put back the code and CSS supplied.

It will not do you any harm to not have it in place for now.

A logo with a h1 text indented is simple, but as I said background images do not have alt text, so it has to be a html element. we will fix this quickly when you can enable the code and I can see what's going on.
Joomla Expert http://http://urlofseo.com/joomla-support-service Expert Joomla Development and Support
Joomla SEO http://urlofseo.com small and medium sized enterprises.

nic2009
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Mar 19, 2009 11:51 am

Re: Why H1 tag not recognized in logo image?

Post by nic2009 » Sat Jan 21, 2012 2:49 am

Hi Harvey51, thousand thanks for your support. The code placed at the moment is the original code from the template. Please let me know how I can be of assistance. Or try to contact me via Skype when you have time to take a closer look. SkypeID: designic.biz

Thanks a lot again & hear you Monday (I am at Bangkok time, so about 6 hours before you)

User avatar
Harvey51
Joomla! Explorer
Joomla! Explorer
Posts: 300
Joined: Tue Feb 23, 2010 8:16 pm
Location: Morecambe UK
Contact:

Re: Why H1 tag not recognized in logo image?

Post by Harvey51 » Mon Jan 23, 2012 10:24 am

Hi Nic,

Can you get the site back to this point
Ok, we are coming closer... ;-)
I placed the CSS code in my CSS file and also placed a h1 tag in the index.html (see below) and it shows that there is a h1 tag in the 'h tag checker':
Then we'll sort through the display.
Joomla Expert http://http://urlofseo.com/joomla-support-service Expert Joomla Development and Support
Joomla SEO http://urlofseo.com small and medium sized enterprises.

nic2009
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Mar 19, 2009 11:51 am

Re: Why H1 tag not recognized in logo image?

Post by nic2009 » Tue Jan 24, 2012 12:34 am

Ok, done. The h1 tag is recognized... but my logo is displayed not exactly on the right position. Waiting for your reply. Thanks a lot.

nic2009
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Mar 19, 2009 11:51 am

Re: Why H1 tag not recognized in logo image?

Post by nic2009 » Tue Jan 24, 2012 1:49 am

Sorry, but had to change the code back to the original as it was not possible to access the menu anymore... and I need it to work on the site.
Could you not just send me the modified code incl. h1 tag, so I just have to place it and everything is fine?

Or is there a time where you in front of the computer, so that I change it for this moment?

Please let me know & thanks a lot.

User avatar
Harvey51
Joomla! Explorer
Joomla! Explorer
Posts: 300
Joined: Tue Feb 23, 2010 8:16 pm
Location: Morecambe UK
Contact:

Re: Why H1 tag not recognized in logo image?

Post by Harvey51 » Tue Jan 24, 2012 10:25 am

There are probably some other CSS rules in place that effect your logo and menu. I would need to see the effect and cause.

My office hours are 10:00 - 16:00 GMT. I check the Joomla forums regularly.
Joomla Expert http://http://urlofseo.com/joomla-support-service Expert Joomla Development and Support
Joomla SEO http://urlofseo.com small and medium sized enterprises.

john_rambo
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Tue Jan 24, 2012 1:15 pm

Re: Why H1 tag not recognized in logo image?

Post by john_rambo » Tue Jan 24, 2012 1:48 pm

thanks for these cods i will use them i hope it will work,, fo me That's a very impressive article, thanks for sharing with us, and hope to read more from you. We've read it many times.

nic2009
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Mar 19, 2009 11:51 am

Re: Why H1 tag not recognized in logo image?

Post by nic2009 » Wed Jan 25, 2012 6:40 am

Hi Harvey51, I would be online now for the next 2-3 hours. Please let me know when you have time. Thanks & bye...

User avatar
Harvey51
Joomla! Explorer
Joomla! Explorer
Posts: 300
Joined: Tue Feb 23, 2010 8:16 pm
Location: Morecambe UK
Contact:

Re: Why H1 tag not recognized in logo image?

Post by Harvey51 » Wed Jan 25, 2012 11:06 am

Hi Nic,

Hope your still there?
Joomla Expert http://http://urlofseo.com/joomla-support-service Expert Joomla Development and Support
Joomla SEO http://urlofseo.com small and medium sized enterprises.

nic2009
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Mar 19, 2009 11:51 am

Re: Why H1 tag not recognized in logo image?

Post by nic2009 » Wed Jan 25, 2012 11:26 am

Yes, do you have Skype? Would be easier, I send you a PM with my Skype ID.
If not, we go on like this... ;-)

User avatar
Harvey51
Joomla! Explorer
Joomla! Explorer
Posts: 300
Joined: Tue Feb 23, 2010 8:16 pm
Location: Morecambe UK
Contact:

Re: Why H1 tag not recognized in logo image?

Post by Harvey51 » Wed Jan 25, 2012 11:36 am

I'm in an office with colleges and clients, and not on my usual machine so this will be easier, just apply the change as previous to the point where your display, menu break and we'll sort it quickly.
Joomla Expert http://http://urlofseo.com/joomla-support-service Expert Joomla Development and Support
Joomla SEO http://urlofseo.com small and medium sized enterprises.

nic2009
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Mar 19, 2009 11:51 am

Re: Why H1 tag not recognized in logo image?

Post by nic2009 » Wed Jan 25, 2012 11:47 am

Ok, done...

nic2009
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Mar 19, 2009 11:51 am

Re: Why H1 tag not recognized in logo image?

Post by nic2009 » Wed Jan 25, 2012 11:49 am

But the h1 tag text is visible (barely visible red font in the Social Bookmarks) and that's why the logo moves downwards.

User avatar
Harvey51
Joomla! Explorer
Joomla! Explorer
Posts: 300
Joined: Tue Feb 23, 2010 8:16 pm
Location: Morecambe UK
Contact:

Re: Why H1 tag not recognized in logo image?

Post by Harvey51 » Wed Jan 25, 2012 11:59 am

The h1 needs to go outside of the anchor, also I cannot see the snippet of CSS previously supplied.
Joomla Expert http://http://urlofseo.com/joomla-support-service Expert Joomla Development and Support
Joomla SEO http://urlofseo.com small and medium sized enterprises.

nic2009
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 104
Joined: Thu Mar 19, 2009 11:51 am

Re: Why H1 tag not recognized in logo image?

Post by nic2009 » Wed Jan 25, 2012 12:03 pm

Outside the anchor...? Sorry, but my HTML is more trial and error...

That's what I meant, that it might be easier that you copy the code, change it and place it again in the post, so that I can just replace it in y index file.

I really don't know where to place the CSS code... in which CSS file exactly??

Thanks a lot

User avatar
Harvey51
Joomla! Explorer
Joomla! Explorer
Posts: 300
Joined: Tue Feb 23, 2010 8:16 pm
Location: Morecambe UK
Contact:

Re: Why H1 tag not recognized in logo image?

Post by Harvey51 » Wed Jan 25, 2012 12:19 pm

Here's what you have:

<div id="logo">
<a title="Fkk und Saunaclubs in Deutschland, Österreich und der Schweiz" href="/index.php"><h1>Fkk und Saunaclubs in Deutschland, Österreich und der Schweiz></h1>
<img title="FKK und Saunaclubs in Deutschland, Österreich und der Schweiz" alt="FKK und Saunaclubs in Deutschland, Österreich und der Schweiz" src="http://www.saunaclub.info/templates/ict ... s/logo.png" alt="FKK und Saunaclubs in Deutschland, Österreich und der Schweiz"/></a>
</div>

Try this instead:

<div id="logo"><h1>Fkk und Saunaclubs in Deutschland, Österreich und der Schweiz
<a title="Fkk und Saunaclubs in Deutschland, Österreich und der Schweiz" href="/index.php">
<img title="FKK und Saunaclubs in Deutschland, Österreich und der Schweiz" alt="FKK und Saunaclubs in Deutschland, Österreich und der Schweiz" src="http://www.saunaclub.info/templates/ict ... s/logo.png" /></a></h1>
</div>

The reason I say try is because you've a lot of text in the h1, a text indent only works for the first line, therefore you might need to reduce the size of the h1.

Also because the image is not a background image, browsers might treat it as text.
Joomla Expert http://http://urlofseo.com/joomla-support-service Expert Joomla Development and Support
Joomla SEO http://urlofseo.com small and medium sized enterprises.

User avatar
Harvey51
Joomla! Explorer
Joomla! Explorer
Posts: 300
Joined: Tue Feb 23, 2010 8:16 pm
Location: Morecambe UK
Contact:

Re: Why H1 tag not recognized in logo image?

Post by Harvey51 » Wed Jan 25, 2012 12:21 pm

Put the CSS at the bottom of template_css.css
Joomla Expert http://http://urlofseo.com/joomla-support-service Expert Joomla Development and Support
Joomla SEO http://urlofseo.com small and medium sized enterprises.


Locked

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 1.5”