Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-07-17 06:43:18

The-Exit
Member
From: Berlin
Registered: 2005-07-16
Posts: 175
Website

­ in title of article

Hi, I just posted an article with a rather long title with very long words in German. In order to have a smooth recent-articles-list, I used the ­ tag between the words. This works really fine, but in txp_page_title ­ translates into a – which is always displayed. Do you know a work around?

Offline

#2 2009-07-17 08:48:49

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: ­ in title of article

Did you try using &173; instead?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Online

#3 2009-07-17 08:56:53

The-Exit
Member
From: Berlin
Registered: 2005-07-16
Posts: 175
Website

Re: ­ in title of article

When entering &173; the hyphen is always displayed :(

Offline

#4 2009-07-17 09:07:24

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: ­ in title of article


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#5 2009-07-17 10:06:09

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: ­ in title of article

txp:page_title /> isn’t the culprit. Look in page source and you’ll see the ­ entity is still there. It’s a browser issue. Interesting article about soft hyphens here, which I won’t pretend to have fully read, but it’s clear that browser handling of ­ is not entirely reliable.


Code is topiary

Offline

#6 2009-07-17 10:44:16

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: ­ in title of article

If you want a workaround, replace <txp:page_title /> with this:

<txp:php>echo str_replace(array('&shy;','&#173;','&#xAD;'),'',page_title(array()));</txp:php>

To set page_title’s separator attribute, use this version:

<txp:php>echo str_replace(array('&shy;','&#173;','&#xAD;'),'',page_title(array('separator'=>': ')));</txp:php>

changing the value as desired (here it’s a colon followed by a space, which is the default value).

Or you could easily make a little plugin out of this.

Last edited by jsoo (2009-07-17 10:45:19)


Code is topiary

Offline

#7 2009-07-18 12:29:04

The-Exit
Member
From: Berlin
Registered: 2005-07-16
Posts: 175
Website

Re: &shy; in title of article

Thank you very much for your help. The workaround just works great. Probably the escaping of html in page_title would be a nice feature for the coming textpattern version :)

Offline

Board footer

Powered by FluxBB