Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2005-12-12 04:24:04

aesop1
Archived Plugin Author
Registered: 2004-09-19
Posts: 142

Re: Alternative to <h1>

Andy Budd says it best after referencing the same W3C spec that Paul mentions above (emphasis is mine) . . . <blockquote>
The purpose of the heading element therefore is to describe the structure and content of the current page, not to describe the structure of the site or how this particular page fits into a larger hierarchy. By using the H1 element to link a document to a group of documents the web author is almost trying to create their own meta data. [ . . . ] <br /><br />

A lot of web authors also mistakenly believe that there should only be a single h1 per page. This makes sense if all the information on the page is about a single subject but it makes less sense if the page has groups of unconnected information. For instance, this article is primarily about headings, however the side bar contains unrelated information. Unfortunately because the sidebar doesn’t have it’s own h1, this information is structurally considered part of the headings article, even though it has nothing to do with it.
</blockquote>

Jeremie, therefore, is correct when he says that there can be multiple h1 headings per web page. The hierarchy is contextual to the web page itself, not the web site structure.

BTW, in terms of actual TXP practice, I tend to use SITE TITLE: [SECTION TITLE] : [ARTICLE TITLE] for my page titles depending on whether I am in a section list or an actual article. <code><txp:page_title /></code> typically doesn’t cut it by its lonesome, so I end up using conditionals to write the <code><title>title element</title></code>

Last edited by aesop1 (2005-12-12 04:51:14)

Offline

#14 2005-12-12 06:44:10

Niconemo
Member
From: Rhône-Alpes, France
Registered: 2005-04-18
Posts: 557

Re: Alternative to <h1>

For instance, this article is primarily about headings, however the side bar contains unrelated information. Unfortunately because the sidebar doesn’t have it’s own h1, this information is structurally considered part of the headings article, even though it has nothing to do with it.

This example is very interesting… While dealing with xhtml structure for a page, we probably all ask ourself that question…

If I could rank this thread I would set it to five stars. All these point of view are very, very, interesting. I’ll probably make up my mind on some poinst… and I like it ! ;-)

There is probably not one single answer, but we have to know what we do and to be coherent within a website.

Last edited by Niconemo (2005-12-12 06:46:00)


Nico

Offline

#15 2005-12-12 11:38:54

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Alternative to <h1>

Therein lies the problem Nico, everybody has their own opinions about this but that’s all they are – opinions. There don’t appear to be any hard and fast rules. For example my h1 does not contain my site name only. Neither does my “title” tag in the head. Aesop1 suggests the use of “SITE TITLE: [SECTION TITLE] : [ARTICLE TITLE]” whereas I would suggest that a better ordering would be “[ARTICLE TITLE] : SITE TITLE : [SECTION TITLE]” so there’s another idea for you to ponder on. :)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#16 2005-12-12 17:24:49

aesop1
Archived Plugin Author
Registered: 2004-09-19
Posts: 142

Re: Alternative to <h1>

I agree, Stuart — there are no hard and fast rules — which is precisely the point that it isn’t “correct” to impose an artificial set of hierarchy rules across a web site via heading tags (which might be meaningful to the site designer, but meaningless to the search engine or web site visitor).

This is also why title element construction can vary — it has to make sense in the context of the information you are trying to convey. No hard and fast rules there either — I just threw out my title construction (which isn’t used in all instances, but many) as one example. If someone is organizing their site with TXP categories, then they may want the title to reflect that instead. So, <code><txp:page_title></code> isn’t inherently wrong or inefficient either. For a simple site it will suffice just fine!

But at the end of the day you probably want to be noticed by search engines, so follow the practices that will get your site noticed — on a page-by-page basis — without worrying about the overall site semantics of heading tags.

Given the search engine consideration, I will have to seriously consider Stuart’s title construction for my own sites: it might be more effective than mine!

Niconemo, I agree—good thread. It is important to consider all these things.

Last edited by aesop1 (2005-12-12 17:26:11)

Offline

#17 2005-12-12 19:39:02

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Alternative to <h1>

Given the search engine consideration, I will have to seriously consider Stuart’s title construction for my own sites: it might be more effective than mine!

Stuart’s suggestion is also effective for users when bookmarking URLs from the same site. I mean, if you bookmark more than one article (ie. URL) from the same site, I think it’s easy to find it if the bookmark title starts with the article title, and not with the site name (repeated several times).

An ontopic question:
What is the importance of H1 in SEO? Really, I dont know, so any link/hint/advice will be welcomed.

If you do a search on Google, you will get results with the following structure (some text removed for brevity):

The content on the title element
some… ¿random?… words…
… on the linked… page…
mysite.com/myarticle

Where is the H1 in a search result?
I dont have any doubt that is important to keep a well-marked-up-and-structured document to improve SEO.

Finally, it’s good to know that Textpattern gives all the possibility of using different headings hiearchies and titles (so, keeping everyone happy) in different contexts (homepage, section/category article list, individual-article, etc) by simple using some conditional tags magic.
Those who want to use H1 always for the site name, can do it easily, and those who want to have “dynamic” H1, too.

Last edited by maniqui (2005-12-12 19:42:27)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#18 2005-12-13 02:06:14

paularms
Member
From: University of Minnesota
Registered: 2004-10-21
Posts: 155
Website

Re: Alternative to <h1>

To answer your question, maniqui,

Where is the H1 in a search result?

It doesn’t necessarily show up in the search results, but the information in an h1 tag is generally given more weight than other markup elements in a document. Therefore, if the page is easily summarized in a few words, people searching for those words are more likely to find your page.

Last edited by paularms (2005-12-13 02:06:49)

Offline

#19 2005-12-13 05:44:55

aesop1
Archived Plugin Author
Registered: 2004-09-19
Posts: 142

Re: Alternative to <h1>

Interestingly enough, I was just doing a “view source” on alistapart.com and saw this . . .

For the title element:

<code>
<title>A List Apart: Articles: Printing a Book with CSS: Boom!</title>
</code>

The masthead:

<code><h1 id=“masthead”>
<a href=”/”><img src=”/pix/alalogo.gif” alt=“A LIST Apart: For People Who Make Websites” /></a>
</h1></code>

And a little further down (the current article title) . . .

<code>
<h1 class=“title”><a href=”/articles/boom”>Printing a Book with CSS: Boom!</a></h1>
</code>

This usage seems to marry usage recommended by several of us in that it does both: 1) allows for multiple h1 tags on a page and 2) Gets the “site title” through the ALT attribute in the image tag within the first h1 element.

I like the idea of using a masthead image within an h1 tag.

Last edited by aesop1 (2005-12-13 05:47:29)

Offline

#20 2005-12-14 18:40:30

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Alternative to <h1>

Amigos,

How would you apply some of this concepts to an eCommerce site? I need/give some advices :)

  • in individual product page
    • product name as H1? or
    • site name as H1?
  • in title element
    • [product name] | [site name] or
    • [site name] | [product name] (i think I like this one for search site results)
    • slogan in title? I think only for the homepage -> conditionals magic.
  • what about section/categories (article list) pages?

Thanks in advance.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#21 2005-12-15 01:44:18

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Alternative to <h1>

For the page is the product name going to appear further down such as in an h2? If so I would stick to using the sitename in the h1. If not use the product name followed by the site name.

In the title element I would use Product – Site name – Section (as long as it isn’t “default”). I don’t usually bother with categories as I think it can be a bit confusing particularly if section is in there.

That’s all just my own opinion of course. ;)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#22 2005-12-15 02:01:57

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Alternative to <h1>

thanks for share your opinion, Stuart.

For the page is the product name going to appear further down such as in an h2? If so I would stick to using the sitename in the h1. If not use the product name followed by the site name.

Now, but that remembered me something: I use subheadings inside the product description (article)… that are “textile-coded” (hardcoded) as h3, so if I apply h1 to the product name (article title), the next heading will be an h3…
I know that isnt a sin to do that… but I want to keep some good practices and consistency.

A workaround could be to code the subheadings as h2, because it’s probably that they wont show up in article-list context (where h2 will be used in product name). They will show up only in individual-article (= individual-product) pages…


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#23 2005-12-20 20:57:24

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Alternative to <h1>

What do you think of using just an <img /> (or an @<a href=”“><img /></a> inside a heading?

I mean, things like:

<h1><img /></h1>
<h1><a href=""><img /></a></h1>

Does it makes any sense to wrap an image, or a linked image with a heading element?

I have seen it in more than one place. Example: Mozilla Corporation
They have both the h1 and the h2 “filled” with linked images…

<hr size=“1” />

maniqui though:

I use subheadings inside the product description (article)… that are “textile-coded” (hardcoded) as h3, so if I apply h1 to the product name (article title), the next heading will be an h3…
I know that isnt a sin to do that… but I want to keep some good practices and consistency.

Jeremie wrote:

Other CMS deal with this by automatically increment the headings withing an article.

Interesting feature!
So, does it mean that the CMS will wrap subheadings (headings inside an article) in relation to the heading level of the article title?

That’s could be a great feature…
For example, if in article-list context, the article title has a h2, and the article subheadings (marked up with some special textile that has to be thinked yet <sup>(*)</sup>) are automatically wrapped in h3.
And if you are in individual-article context, the article title has a h1 and the article subheadings are automatically wrapped with h2.

A first problem could be how to detect which heading level is wrapping the txp:title. Dont know if possible…

<sup>(*)</sup>The textile mark-up could be something like: hn., hnn., hnnn. and so on.

Last edited by maniqui (2005-12-20 21:00:29)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#24 2005-12-20 21:59:33

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Alternative to <h1>

I would say that for your h1 examples the “alt” attribute content would be very important and maybe the “title” attribute in the “a” tag.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB