Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-04-22 06:37:06

mattmikulla
Member
From: Nashville Tennessee
Registered: 2004-08-25
Posts: 281
Website

How Do I Create a Page Title Without the Site Name

Is there a way to create a page title without including the site name by default?

I am using the txp:page_title tag currently. I have read that including the sitename: page title for each page is not search engine optimized.

It would be great if there was a tag attribute in txp:page_title to not include the site name.


Art Rogue – Fine Art Photography

Offline

#2 2007-04-22 07:29:07

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: How Do I Create a Page Title Without the Site Name

mattmikulla wrote:

Is there a way to create a page title without including the site name by default?

I believe there’s a plugin to customize your page title.

I am using the txp:page_title tag currently. I have read that including the sitename: page title for each page is not search engine optimized.

That’s very questionable. Myself, I would say it’s the other way around.

Last edited by Jeremie (2007-04-22 07:29:25)

Offline

#3 2007-04-23 13:39:25

kevinpotts
Member
From: Ghost Coast
Registered: 2004-12-07
Posts: 370

Re: How Do I Create a Page Title Without the Site Name

This is easily done with a simple article tag. For instance, I usually add something like this to my page inside the <head> tag:

<txp:if_individual_article><txp:article form="meta_dynamic"></txp:if_individual_article>

And then the form meta_dynamic could contain any variable you’d find in an article tag, such as title, custom field, etc. For instance, any one of these could comprise the meta_dynamic form:

<title><txp:sitename />: <txp:title /></title> (default)
<title><txp:sitename />: <txp:category1 title="1" />: <txp:title /></title>
<title><txp:section title="1" /> | <txp:title /></title>
<title><txp:section title="1" /> | <txp:custom_field name="special_CF_for_page_title" /></title>

etc … this way the title tag is completely customized.


Kevin
(graphicpush)

Offline

#4 2007-04-23 15:30:05

mattmikulla
Member
From: Nashville Tennessee
Registered: 2004-08-25
Posts: 281
Website

Re: How Do I Create a Page Title Without the Site Name

Thanks Kevin. I’ll give it a try.


Art Rogue – Fine Art Photography

Offline

#5 2007-04-23 16:19:52

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: How Do I Create a Page Title Without the Site Name

There’s also ob1_title

Offline

#6 2007-05-06 01:53:13

wagerrard
New Member
Registered: 2007-05-01
Posts: 2

Re: How Do I Create a Page Title Without the Site Name

Putting this in the header, between <head> and </head> works for me. You can keep or omit the sitename as you wish.

<txp:if_individual_article>
     <title><txp:title /> : <txp:sitename /></title>
<txp:else />
     <title><txp:page_title /></title>
</txp:if_individual_article>

Last edited by wagerrard (2007-05-06 02:06:31)

Offline

#7 2007-09-11 22:55:06

mattmikulla
Member
From: Nashville Tennessee
Registered: 2004-08-25
Posts: 281
Website

Re: How Do I Create a Page Title Without the Site Name

I am getting an error because the txp:title is to be used in an article form and not in a page or column. I have the result that I want though. Any ideas?

wagerrard wrote:

Putting this in the header, between <head> and </head> works for me. You can keep or omit the sitename as you wish.

<txp:if_individual_article>
     <title><txp:title /> : <txp:sitename /></title>
<txp:else />
     <title><txp:page_title /></title>
</txp:if_individual_article>

Last edited by mattmikulla (2007-09-11 22:56:01)


Art Rogue – Fine Art Photography

Offline

#8 2007-09-11 23:39:34

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: How Do I Create a Page Title Without the Site Name

Since version 4.0.5. you have been able to put <txp:title /> (and other article-tags) outside article-form, if it is surrounded with <txp:if_individual_article>.

Cheers!

Offline

#9 2007-09-12 08:45:31

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: How Do I Create a Page Title Without the Site Name

And <txp:if_individual_article> is only needed if you also use the template/page for article lists. When used only for individual article pages, it’s not needed.

Offline

#10 2007-09-12 14:45:45

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

Re: How Do I Create a Page Title Without the Site Name

Gocom wrote:

Since version 4.0.5. you have been able to put <txp:title /> (and other article-tags) outside article-form, if it is surrounded with <txp:if_individual_article>.

I’ve reported some kind of bug: it seems that txp:title doesn’t work in individual article context for sticky articles.
I’ve seen that on two sites developed by me.

Could anyone do a test and confirm?

Last edited by maniqui (2007-09-12 14:49:22)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#11 2007-09-12 14:48:00

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: How Do I Create a Page Title Without the Site Name

In the upcoming TXP 4.0.6 that should work again.

Offline

Board footer

Powered by FluxBB