Line break in Text area

Hi there,

In order to display each property on another line, I need to use the
tag. Is there a way to accomplish the same result without having to use the
tag?

This is how I need to put it to cause a line break:

<br>Höhe: 90 cm
<br>Breite: 90-200 cm </br>
<br>Länge: 200 oder 220 cm </br>
<br>Bettbreite: 110-220 cm </br>
<br>Bettkantenhöhe: Standard 38 cm oder Komfort 45 cm</br>

Attached is a scrrenshot

Try using this:

This is my code which outputs the text: <div><?php echo $betten->accordionbeschreibungeins(); ?></div>

I put it like this but there is no line break: <div><?php echo nl2br($betten->accordionbeschreibungeins()); ?></div>

Wouldn’t a structure field be better suited for this?

or

Thanks, that did it but the letters are in lower case and there is a dash at the top which I can’t get rid of with too much spacing between Produktinfos and ‘höhe’. Also the number values are in quotes which is not what I want.
Screenshot_20231003_143008

This is the entire yml code:

title: Betten
preset: page
num: zero
duplicate:	true

status:
  draft: true
  listed: true

fields:
  Name:
    label: Produktname
    type: text

  Beschreibung:
    label: Beschreibung
    type: text

  Accordionbeschreibungeins:
    label: Produktinfos
    type: structure
    fields:
      Höhe:
        label: Höhe
        type: text
      Breite:
        label: Breite
        type: text
      Länge:
        label: Länge
        type: text
      Bettbreite:
        label: Bettbreite
        type: text
      Bettkantenhöhe:
        label: Bettkantenhöhe
        type: text

  Accordionbeschreibungzwei:
    label: Oberfläche
    type: text

  files:
    label: Produktbild
    type: files
    template: image

 structure:
  label: Holzarten
  type: structure
  fields:
    image:
      label: Image
      type: files
      layout: cards
      max: 1
    label:
      label: Label
      type: text
      default: Label
      
 structuretwo:
  label: Stoffe
  type: structure
  fields:
    image:
      label: Image
      type: files
      layout: cards
      max: 1
    label:
      label: Label
      type: text
      default: Label
      




Please read the documentation. This forum is not a replacement for consulting the docs on how to output field values. It’s all there.

@texnixe I read this documentation and there is no mention of lower case/upper case: Structure | Kirby CMS

Tip: Do not use umlauts in field names. These are already marked in red here.
Bettkantenhöhe -> bettkantenhoehe

And for pure numerical values you can use the number field.

bettkantenhoehe:
  label: Bettkantenhöhe
  type: number

The output in minuscules is not specified in the blueprint.
Please post the corresponding code snippet from the template.

Hi, I read the doc link you provided and the issue is still the same. This is the corresponding code snippet from the template: <div><?php echo nl2br($betten->accordionbeschreibungeins()); ?></div>

And this is the edited yml part:

Accordionbeschreibungeins:
    label: Produktinfos
    type: structure
    fields:
      Hoehe:
        label: Höhe
        type: number
      Breite:
        label: Breite
        type: number
      Laenge:
        label: Länge
        type: number
      Bettbreite:
        label: Bettbreite
        type: number
      Bettkantenhoehe:
        label: Bettkantenhöhe
        type: number

Not to add to the confusion, but unless you want to have more than 1 “Bettkantenhöhe” per product, the structure field won’t add anything useful to your situation.

The structure field is for “repeating content”.
The textarea is completely fine for your needs. Don’t use the the structure field for this.

@texnixe I read this documentation and there is no mention of lower case/upper case: Structure | Kirby CMS

Texnixe pointed you to this page: Textarea | Kirby CMS
Lemmon pointed you here: $field->nl2br() | Kirby CMS

Both are valid solutions. Chose one of those.

Or just go back to what you had initially and add the same nl2br function around the field, like you have in your last code snippet, that’s fine too.
If you’re interested in Kirby, you really should however learn how fields and field methods work.

Removing the type: structure will result in an error message showing in the panel.

That probably is because fields need to have a type.

Nope. I tried that already.

Did you see an error message in the panel when you first opened this thread?
I guess not. Go back to that situation.

I was able reverse it by adding ‘structure’ back, but that doesn’t change the situation shown in the screenshot.

No. Go back to the situation you had when opening this thread. There was no structure field here:

And then?

You there yet?

I’m already there.