Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
[SOLVED] txp:site_name
Is there a way to add underscores to site_names that include spaces? ie. I’m looking for a way to convert “My txp Site” to “My_txp_Site” (in relation to this post).
Edited to add that trimming spaces would also be acceptable but <txp:site_name trim=" " />
did not work.
Last edited by colak (2020-07-07 07:22:57)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: [SOLVED] txp:site_name
Trim:
<txp:site_name trim="/\s+/" />
Replace:
<txp:site_name trim="/\s+/" replace="_" />
or simply
<txp:site_name trim replace="" /> and <txp:site_name trim replace="_" />
Offline
Re: [SOLVED] txp:site_name
etc wrote #324331:
Trim:
<txp:site_name trim="/\s+/" />...
Replace:
<txp:site_name trim="/\s+/" replace="_" />...
These work beautifully. Thanks so much Oleg.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Offline
Re: [SOLVED] txp:site_name
etc wrote #324334:
It’s even documented :-)
I did see that but I didn’t know that there was a regex for the space character hence my example in the first post of the thread:)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Pages: 1