1

Shopware only accept snippets files in .json format.

How to handle multine text?

rammi22
  • 271
  • 1
  • 11

1 Answers1

3

Either use \\n for new line or, if the snippet is used in html, <br>.

{
  "snippet1": "First line<br>Next line",
  "snippet2": "First line\\nNext line"
}
dneustadt
  • 12,015
  • 1
  • 12
  • 18
tinect
  • 491
  • 2
  • 5
  • @dneustadt Ok, in js/twig i call then `snippets1 + snippest2 + ...`, but what about if the spanish translation has more `snippet*` than other translations? Sholud i first check the current language each time? – rammi22 Jan 20 '23 at 13:30
  • @tinect at my opinion, it is the same context, but please take a look https://stackoverflow.com/questions/75184806/shopware-6-custom-plugin-snippets-with-dynamic-multilines – rammi22 Jan 20 '23 at 13:44