Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Get Rid of Strange Code In Title
A bit of a strange one.
I’ve just tried to add a retweet button to my individual articles.
It won’t work because the title always has %A0 between the last two words eg. Scotland+Ready+For%A0Tour
I’ve noticed this if I post a link in Facebook too. It works but would look like this …. Scotland Ready ForTour
I always put it down to a strange quirk in Facebook but it seems now this isn’t the case.
Can anybody shed light on why this code is appearing in the title when the articles are shared on these social networks?
Thanks
Geoff
Last edited by geoff777 (2010-06-04 07:15:19)
There are 10 types of people in the world: those who understand binary, and those who don’t.
Offline
Re: Get Rid of Strange Code In Title
The %A0
is the hexcode of the  
(dezimal) or
(html). The  
is included from Textpattern to prevend linebreaks of a single last word in the title. The %A0
is only a URL-safe equivalent of this char. Normally it doesn’t matter.
But you can suppress this behavior in your Textpattern advanced settings by disabling the »Prevent widowed words in article titles?«
Last edited by trenc (2010-06-04 07:47:55)
Digital nomad, sailing the world on a sailboat: 32fthome.com
Offline
Re: Get Rid of Strange Code In Title
Thanks Trenc,
I have noticed that option in Advanced settings but have never given it any thought …
Cheers
Geoff
There are 10 types of people in the world: those who understand binary, and those who don’t.
Offline
Re: Get Rid of Strange Code In Title
Or you can turn it off on a case-by-case basis using the <txp:title />
tag’s nowidow attribute. Useful perhaps if you only want to affect one particular Page template or Form and leave the rest alone.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Get Rid of Strange Code In Title
How embarrassing, I did not know this attribute.
Thanks stef
Digital nomad, sailing the world on a sailboat: 32fthome.com
Offline
Re: Get Rid of Strange Code In Title
Stef I don’t like the documentation. It needs real world examples :)
no_widow=“boolean” Setting this attribute inhibits line breaks which would leave just a single word on the last line (widows ). Default: As set by Prevent widowed words in article titles in Advanced Preferences
And I would like the ‘boolean’ to be a real Yes (1) / No (0) instead of relying on the state of the ‘Advanced Preferences’ setting. Or is it a real Yes (1) / No (0)?
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
Re: Get Rid of Strange Code In Title
merz1 wrote:
I don’t like the documentation.
imho, whoever decided to use a negative as an attribute name needs a good shoeing! Far better would have been allow_widow
(i.e. 0 = No = don’t leave the last word on its own) or similar *sigh*
Rule #1: always use the positive. But I’ve encountered confusing options like do_not_avoid_previously_disabled_widget_inhibiting_behaviour
in mainstream products before :-S
Last edited by Bloke (2010-06-04 10:23:21)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Get Rid of Strange Code In Title
Stef Let’s fine tune the details for (negative) widow_control
:)
0 – allow the last word in the title to wrap
Title wrapping is controlled by browser. A single last word in one line (the widow) is allowed to be in its own line. The title content is rendered unchanged.
1 – ensure the last word is never left on its own line
Positive? Textpattern inserts an invisible code to make sure that at least two last words are wrapped in one line inside the browser.
Add technical explanation or link to the documentation for admin pref ‘no widow’?
(Pretty soon offline until Monday. Have a nice weekend :)
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
Pages: 1