Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-11-10 08:08:18

stag*
Member
From: Germany
Registered: 2018-06-16
Posts: 10

txp:email subject with generated title

Hello everybody.
I’m trying to have an email link with subject line generated from article title. I thought to do it like this:

<txp:email email=“mail@….com?subject=<txp:title />” />

But… this outputs “<txp:title />” as subject instead of the actual title itself. Am I overlooking anything or do I have to use a plugin for this?

Offline

#2 2018-11-10 09:08:18

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: txp:email subject with generated title

Hello, try with single quotes:

<txp:email email='mail@….com?subject=<txp:title />' />

Offline

#3 2018-11-10 11:05:49

stag*
Member
From: Germany
Registered: 2018-06-16
Posts: 10

Re: txp:email subject with generated title

Cool, this works. Thank you!

Two things occur: 1. Longer titles are cut off unless „prevent widowed words“ is deactivated in preferences.
2. Special characters are not encoded properly. Escape=“html” doesn’t seem to have an effect here?

Edit: I use dashes (–) in titles.

Last edited by stag* (2018-11-10 11:12:13)

Offline

#4 2018-11-10 12:00:46

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

Re: txp:email subject with generated title

Did you try <txp:page_title />?


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

Offline

#5 2018-11-10 12:34:33

stag*
Member
From: Germany
Registered: 2018-06-16
Posts: 10

Re: txp:email subject with generated title

Trying….

<txp:title /> and <txp:page_title /> show the same result:

A dash ist rendered into “–”.

Offline

#6 2018-11-10 13:04:56

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: txp:email subject with generated title

It’s an old function, without multibyte support. Fixed in 4.7.2 (pending commit).

Offline

#7 2018-11-10 13:18:25

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: txp:email subject with generated title

stag* wrote #315139:

Two things occur: 1. Longer titles are cut off unless „prevent widowed words“ is deactivated in preferences.
2. Special characters are not encoded properly. Escape=“html” doesn’t seem to have an effect here?

Both should be solved in 4.7.2 with

<txp:email email='mail@….com?subject=<txp:title escape="url" />' />

We hope to release it by the end of this year.

Offline

#8 2018-11-10 13:24:32

stag*
Member
From: Germany
Registered: 2018-06-16
Posts: 10

Re: txp:email subject with generated title

Not a big thing.
But hey, thanks for looking into this anyway, really much appreciated how supportive you guys always are!

Offline

Board footer

Powered by FluxBB