You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Question: how to add new lines in CSV metadata so they display on the item pages?
Answer:
when the metadata is feed into the item pages, it is used as HTML, so a new line doesn't change the display (HTML ignores extra white space). So if you want content in your metadata to display with some format, you can use html in your metadata spreadsheet. An easy way to get a line break is to just add <br> in your metadata (replace your \n with <br>). But you could also do more fancy formatting, such as wrapping the parts of the description in paragraph tags <p>.
For example:
title,description
Example Item,"Line one.<br>Line two"
Another Item,"<p>First paragraph.</p><p>Second paragraph, some <strong>bold text</strong>, and a <a href='https://example.com'>link</a>.</p>"
^This will work out of the box.
If you want to do more customizing, we have sometimes added a filter to the item layout to parse the metadata fields as Markdown, so that you can write markdown in your spreadsheet.
In that case your csv would look like:
title,description
Example Item,"Line one.
Line two"
Another Item,"First paragraph.
Second paragraph, some **bold text**, and a [link](https://example.com)"
Notice, you don't use \n, you just actually put in new lines, but they are inside quoted cells in the csv, so will be interpreted as new lines.
In the template, the place where the metadata will be displayed you add the Liquid filter | markdownify to render the markdown to html.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Question: how to add new lines in CSV metadata so they display on the item pages?
Answer:
when the metadata is feed into the item pages, it is used as HTML, so a new line doesn't change the display (HTML ignores extra white space). So if you want content in your metadata to display with some format, you can use html in your metadata spreadsheet. An easy way to get a line break is to just add
<br>
in your metadata (replace your\n
with<br>
). But you could also do more fancy formatting, such as wrapping the parts of the description in paragraph tags<p>
.For example:
^This will work out of the box.
If you want to do more customizing, we have sometimes added a filter to the item layout to parse the metadata fields as Markdown, so that you can write markdown in your spreadsheet.
In that case your csv would look like:
Notice, you don't use
\n
, you just actually put in new lines, but they are inside quoted cells in the csv, so will be interpreted as new lines.In the template, the place where the metadata will be displayed you add the Liquid filter
| markdownify
to render the markdown to html.Beta Was this translation helpful? Give feedback.
All reactions