Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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,477
Re: Option to escape HTML in site_name and site_slogan
Just use … (I supose your site is in UTF-8)
Offline
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,477
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
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 …. That won’t help for <em>, though.
Offline
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
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
Re: Option to escape HTML in site_name and site_slogan
Thanks, James – another great idea. Appreciated.
Offline