Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-07-23 13:12:18

Hiram
Member
From: Utrecht, Netherlands
Registered: 2004-02-16
Posts: 35
Website

... prevent the site name from appearing in the page title?

Using the txp:page_title tag, the site’s name is repeated in all page titles. This causes my pages to receive a lower ranking, with Google, than competitors’ pages that have the search term, and nothing or little more, in their pages titles.

As an expample: If a have a site called ‘The Dutch Dairy Factory’ and an article ‘Edam cheese’, that page will have ‘The Dutch Dairy Factory: Edam cheese’ for a title, whereas my non-Txp-using competitors would have pages entitled simply ‘Edam cheese’, and those pages would show up above mine in Google’s listings, when users search for ‘Edam cheese’.

Last edited by Hiram (2006-07-23 13:13:12)

Offline

#2 2006-08-02 18:36:54

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

Re: ... prevent the site name from appearing in the page title?

It looks like <a href=“http://textpattern.org/plugins/183/ob1title”>ob1_title</a> might help here.

From what I understand a tag like this:
<code><txp:ob1_title order=”%article” /></code>

…*should* output nothing but the article’s title omitting the site name – I haven’t tried it though.

Cheers Martin

Offline

#3 2006-08-02 19:24:14

NyteOwl
Member
From: Nova Scotia, Canada
Registered: 2005-09-24
Posts: 539

Re: ... prevent the site name from appearing in the page title?

That’s an easier route. I hacked taghandlers.php to have it behave the way I wanted :)


Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;

Offline

#4 2006-08-03 13:02:56

Hiram
Member
From: Utrecht, Netherlands
Registered: 2004-02-16
Posts: 35
Website

Re: ... prevent the site name from appearing in the page title?

Thanks! The txp:ob1_title plugin does just what I wanted.

Offline

#5 2006-08-04 01:13:14

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: ... prevent the site name from appearing in the page title?

In the next release of Textpattern you should be able to more easily customize page titles, as article tags will work outside of article forms. :)

i.e:

page:

<title><txp:output_form form="page_title" /></title>

page_title form:

<txp:if_status status="200">

	<txp:if_section name="default">

		<txp:sitename />

	<txp:else />

		<txp:if_article_list>

			<txp:section title="1" /> · <txp:sitename />

		<txp:else />

			<txp:title /> · <txp:sitename />

		</txp:if_article_list>

	</txp:if_section>

<txp:else />

	<txp:error_status /> · <txp:sitename />

</txp:if_status>

(Spaced out so you can easily read it). You could also add category info in there too, etc.

The above works great because then the page title comes first, so Google likes it, but it’s also got the site title in there, so if users bookmark it, they’ll know what site it’s for.

Offline

#6 2006-09-28 03:34:11

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: ... prevent the site name from appearing in the page title?

Should be. I wouldn’t swap just for that reason though.

Offline

#7 2006-09-28 20:30:01

hamba
Member
Registered: 2006-08-04
Posts: 22

Re: ... prevent the site name from appearing in the page title?

Hi Mary

This workes very nicely for me but if I go to a sticky article I get this error

<code>tag_error <txp:title/> -> Textpattern Notice: error_article_context on line 1837</code>

<code>textpattern/lib/txplib_misc.php:1837 trigger_error()
textpattern/publish/taghandlers.php:1774 assert_article()
textpattern/publish.php:956 title()
processTags()
textpattern/publish.php:915 preg_replace_callback()
textpattern/publish/taghandlers.php:2247 parse()
textpattern/publish.php:956 if_article_list()
processTags()
textpattern/publish.php:915 preg_replace_callback()
textpattern/publish/taghandlers.php:2597 parse()</code>

I’m using version: 4.0.3 (r1836)

Cheers
hamba

Last edited by hamba (2006-09-28 20:30:56)

Offline

#8 2006-09-29 01:04:58

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: ... prevent the site name from appearing in the page title?

You won’t be able to do it that way in 4.0.3. You’ll need to call <txp:title /> from an article form.

Offline

#9 2006-09-29 02:58:47

hamba
Member
Registered: 2006-08-04
Posts: 22

Re: ... prevent the site name from appearing in the page title?

I’m using ob1_title for now

thanks for the answer

Offline

#10 2006-09-30 11:46:54

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: ... prevent the site name from appearing in the page title?

Mike: please elaborate in the appropriate forum.

Offline

#11 2006-10-10 10:04:26

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: ... prevent the site name from appearing in the page title?

mary, just:

THANX (for the title script)!


A hole turned upside down is a dome, when there’s also gravity.

Offline

Board footer

Powered by FluxBB