Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
How do I convert line breaks on File Description?
Hey!
I will like use the file description field as my “body” and I need to convert the line breaks
In the past Ruud gived me a code for linebreaks for custom fields:
<txp:php>
echo nl2br(trim(custom_field(array('name' => 'your_custom_field_name'))));
</txp:php>
How do I change it to be for the file_download_description please?
Offline
#2 2009-10-14 16:21:15
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How do I convert line breaks on File Description?
You can also use upm_textile :)
Offline
Re: How do I convert line breaks on File Description?
Thanks that is cool!
can I make it to only convert linebreaks and not use any other Textile’s features please?
Offline
Re: How do I convert line breaks on File Description?
THE BLUE DRAGON wrote:
How do I change it to be for the file_download_description please?
<txp:php>
echo nl2br(trim(file_download_description(array())));
</txp:php>
If you don’t want the description to be HTML-escaped:
<txp:php>
echo nl2br(trim(file_download_description(array('escape'=>0))));
</txp:php>
Code is topiary
Offline
Re: How do I convert line breaks on File Description?
Thanks Jeff! =)
Offline