Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-10-06 07:36:07

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 6,200
Website

page_title

I know it has been answered a million times but I can not think of keywords to use in the forum.

Is there a way to omit the site name from the page title? ie. at the moment we get Site name: Page title. I would like to just get Page title


Yiannis
——————————
neme.org | hblack.net | LABS | NeMe @ github

Offline

#2 2017-10-06 12:24:05

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,136
Website

Re: page_title

Not sure if this is what you want:

<txp:title /> | <txp:site_name /> // individual article
<txp:section title="1" /> | <txp:site_name /> // section page

IOW, build it manually ?

Offline

#3 2017-10-06 12:42:01

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 6,200
Website

Re: page_title

Thanks! I’ll give it a try…


Yiannis
——————————
neme.org | hblack.net | LABS | NeMe @ github

Offline

#4 2017-10-06 14:36:23

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 6,200
Website

Re: page_title

Hi Philippe,
Following your suggestion I have the code below which works just fine. The site is using only using sections.

<txp:if_section name='<txp:section />'>
<h1><txp:section title="1" /></h1>
<txp:else />
<h1><txp:title /></h1>
</txp:if_section>

Yiannis
——————————
neme.org | hblack.net | LABS | NeMe @ github

Offline

#5 2017-10-06 14:40:22

philwareham
Core designer
From: Farnham, Surrey, UK
Registered: 2009-06-11
Posts: 2,776
Website

Re: page_title

phiw13 wrote #307304:

IOW, build it manually ?

Yes, that would be my suggestion too. Better control over the output.

Offline

#6 2017-10-07 00:29:56

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 1,136
Website

Re: page_title

colak wrote #307308:

Hi Philippe,
Following your suggestion I have the code below which works just fine. The site is using only using sections.

<txp:if_section name='<txp:section />'>...

Yiannis,
I’m confused. In your OP, you talk about the <txp:page_title /> tag – which is intended to generate the <title /> tag (in the <head /> docs. But your code snippet shows you want to use it in the <body />… For the latter the most logical tags are the ones I mentioned. My suggestion was for an alternative to populate the <title />, for which <txp:page_title /> is a bit limited (if memory serves there have been some discussions about making that tag more flexible, but I can’t immediately find it).

Offline

#7 2017-10-07 05:33:52

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 6,200
Website

Re: page_title

Apologies for not be so clear. Basically I was looking for a way to omit the site name from the site’s <body>. The code above does not work for the home page but the code below does in all the situations I am dealing with.

<txp:if_section name="">
<h1><txp:site_name /></h1>
<txp:else />
<txp:if_section name='<txp:section />'>
<h1><txp:section title="1" /></h1>
<txp:else />
<h1><txp:title /></h1>
</txp:if_section>
</txp:if_section>

Yiannis
——————————
neme.org | hblack.net | LABS | NeMe @ github

Offline

Board footer

Powered by FluxBB