Notice

This old forum is now only available for consultation/read. User accounts on this old website are blocked.
Please create a new account on seblod.com and use the new forum http://www.seblod.com/community/forums.
Apologies for this perturbation and thank you for your understanding!
Welcome, Guest
Username Password: Remember me

Textarea value rendered without line breaks
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Textarea value rendered without line breaks

Textarea value rendered without line breaks 2 years, 3 months ago #1

  • gebeer
  • ( User )
  • OFFLINE
  • Expert Boarder
  • Posts: 96
Hello,

I often have the case where I render the value of a textarea in the content as value. Unfortunarely SEBLOD doesn't render the line breaks.

Example:
In the site form user enters this into textarea (no wysiwig):
line 1
line 2

If I set Variation to "Value" in the content, SEBLOD renders like this:
line 1 line 2

This is not so nice.

If I set Variation to "Readonly", SEBLOD renders the line breaks, but also the whole textarea with borders, background and font. This doesn't look very nice in he most cases.

What can we do about this?

After reading up on the subject in general HTML and PHP terms, I found that line breaks of a textarea can be preserved with a little bit of PHP code:

str_replace("\r",'<br>',$string);


Now how to implement this into SEBLOD without custom template?

Maybe field 42 can help?

Any suggestions are much appreciated.

Re: Textarea value rendered without line breaks 1 year, 9 months ago #2

  • Beluga
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 62
Any solution for this? My specific problem is that I built a contact form, which sends email and the message in the email construction has
$cck->getValue('palaute_viesti');
for the value of a textarea and thus the line breaks are lost.

Re: Textarea value rendered without line breaks 1 year, 9 months ago #3

  • Beluga
  • ( User )
  • OFFLINE
  • Senior Boarder
  • Posts: 62
Will this be fixed in the next major release? I can live with this until the update..

Re: Textarea value rendered without line breaks 1 year, 8 months ago #4

Hi guys,

Yes this is fixed in our upcoming major release.

Thanks & Regards,
Saba.
...

Re: Textarea value rendered without line breaks 1 year, 8 months ago #5

  • gebeer
  • ( User )
  • OFFLINE
  • Expert Boarder
  • Posts: 96
Great to hear!

Can't wait for the upcoming release
  • Page:
  • 1
Time to create page: 0.19 seconds