WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Bakery Shop => Topic started by: gearup on October 08, 2012, 08:57:02 PM

Title: Bakery 1.60: Product Brief Description: Line Break[solved]
Post by: gearup on October 08, 2012, 08:57:02 PM
Hi,

I am trying to finsd a way of inserting a line break into this field but whatever I have tried so far seems to have been ignored.

For example, if I enter in this field,

Pack Size: Capsules x 20
You Save: 20.55€

on the webpage this is displayed as,

          <product name>
Pack Size: Capsules x 20 You Save:
                 20.55€
               <stock ...>

instead of,

     <product name>
Pack Size: Capsules x 20
    You Save: 20.55€
        <stock ...>

Does anyone know how to control the text in this field to get a line feed function when the text is displayed?

Regards,
Title: Re: Bakery 1.60: Product Brief Description: Line Break
Post by: Ruud on October 08, 2012, 10:58:28 PM
A line-break is ignored in HTML. To work, it should be translated to a <br/>.
PHP has a special function (http://php.net/manual/en/function.nl2br.php) for that, but it will mean you need to modify your bakery filoes to get that working.

You could make a workaround by using droplets.

Create a  droplet, call it "br".
For the droplet content use:
   return '<br />';

In the bakery fields you now can use [[br]] to generate a linebreak.

I could think of other solutions (like translating something like || to a <br/> ), but this would be the most simple solution.
Title: Re: Bakery 1.60: Product Brief Description: Line Break
Post by: jacobi22 on October 09, 2012, 12:20:38 AM
sorry, i'm german ;-)

is brief description the short description?

if so, have you tried to use a wysiwyg-Editor for this?
with wysiwyg its no problem to style your short description (and line breaks too)

here is a german HOW-TO, but its easy to understand

https://forum.WebsiteBaker.org/index.php/topic,22322.0.html
Title: Re: Bakery 1.60: Product Brief Description: Line Break[solved]
Post by: gearup on October 09, 2012, 06:16:12 AM
Hi,

Thanks Ruud for your suggestion, it would have been interesting to try as I have not used droplets yet. I tried to use one before but did not understand how to get it to work, I put this learning in the tray for later.

Jacobi22, your linked solution works fine and is implemented, see image, thanks.

Using a WYSIWYG editor for this field seems a good choice, maybe it could be added to Bakery as standard?

Regards,