Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
<txp:expires formatting - instead of space
Hi.
I’m using expires to output the expiry time/date of a single article. It’s being used within a table context and as the table is dynamically sized, the result is spreading over two lines. I’d like to be able to replace the space characters in the output to
characters so the line isn’t broken – that is, it’s a single line.
I’m using this syntax:
<div style=“text-align:center;”><txp:expires format=”%b %d, %Y” /></div>
Right now, I have this as a result:
Jan 01,
2013
…and I’d like to have
Jan 01, 2013
I can get around this by forcing the <td>
to be a fixed/minimum width, but I’d prefer not to if it can be avoided in a native way. I can see the most logical fix would be to change the output to use
instead of space, though I’m definitely open to other advice.
Thanks in advance.
Last edited by gaekwad (2012-06-20 08:06:58)
Offline
Re: <txp:expires formatting - instead of space
gaekwad wrote:
I’d like to be able to replace the space characters in the output to
characters so the line isn’t broken – that is, it’s a single line.
Well, you can use anything in the format
, including HTML as you see fit. If you want non-breaking space there, you can use one. E.g.
<txp:expires format="%b %d, %Y" />
Offline
Re: <txp:expires formatting - instead of space
I’d say that:
<div style="text-align:center;"><txp:expires format="%b %d, %Y" /></div>
would be the simplest option.
Of course, Gocom was faster, and Textile ate my & # 160 ;
Last edited by Bloke (2012-06-20 08:39:19)
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: <txp:expires formatting - instead of space
Gocom and Bloke – thank you, you’re both absolutely right. Big appreciation, thanks for your time and input.
PS: it’s pretty obvious when you say it out loud…how embarrassing.
Last edited by gaekwad (2012-06-20 08:46:08)
Offline