Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-07-05 12:27:51

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Option to escape HTML in site_name and site_slogan

There are occasions I use an ellipsis (…) in my site slogan.

As I understand it, there’s no native way to escape the HTML from site_slogan or site_name.

I could use rah_replace to bodge it, but it’d be great to have escape="html" permissible in site_slogan and site_name.

Last edited by gaekwad (2014-07-05 12:40:01)

Offline

#2 2014-07-05 17:09:59

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: Option to escape HTML in site_name and site_slogan

Just use … (I supose your site is in UTF-8)

Offline

#3 2014-07-05 20:46:17

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: Option to escape HTML in site_name and site_slogan

Hey GugUser – you’re right, it is a UTF8 site. I’m using … as an example, I’ve tried to use em for part of the site name before, but haven’t been able to.

Offline

#4 2014-07-05 21:06:25

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: Option to escape HTML in site_name and site_slogan

I think it should be possible with upm_textile.

<txp:upm_textile><txp:site_name /></txp:upm_textile>

Last edited by GugUser (2014-07-05 21:28:18)

Offline

#5 2014-07-05 21:50:36

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

Re: Option to escape HTML in site_name and site_slogan

<txp:upm_textile><txp:site_name /></txp:upm_textile> won’t work if the site name is My <b>bold</b> site (too late to textile), but will for My *bold* site. The easiest workaround is

<txp:php>echo $GLOBALS['sitename'];</txp:php>

But since this is a feature request, I’d rather suggest setting $double_encode = false in txpspecialchars by default, to enable the use of &hellip;. That won’t help for <em>, though.

Offline

#6 2014-07-05 21:55:41

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: Option to escape HTML in site_name and site_slogan

I can change the slogan and name, that’s trivial to do – and I like the workarounds.

Gentlemen, thank you.

Offline

#7 2014-07-10 11:29:52

CodeWalker
Member
From: Hampshire, UK
Registered: 2010-01-08
Posts: 110
Website

Re: Option to escape HTML in site_name and site_slogan

Just to throw something else into the mix, I have done stuff like this with pax_grep plugin.

For instance, stripping P tags out of something thats supposed to go in a meta tag.

Hope that helps.

Offline

#8 2014-07-10 11:51:11

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,137
GitHub

Re: Option to escape HTML in site_name and site_slogan

Thanks, James – another great idea. Appreciated.

Offline

Board footer

Powered by FluxBB