Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I am in the middle of a rebuild and trying to move all my product descriptions across in bulk from a multi line text metafield back into the main description body html.
The data for the multi-line text metafield is only stored in Shopify as plain text data. When I use the app Matrixify to export this metafield it comes into an excel spreadsheet as plain text but with all line breaks present, in the same structure it appears on Shopify.
I can then import this plain text data through Matrixify into the body html and it will generate the line break tags for me. This works perfectly but I’m running into some trouble as the app Matrixify will not auto generate the line break tags if there are any html tags included in the plain text file.
Some of these plain text descriptions in my spreadsheet have html tags written into them, as my old theme would render these on my site.
Does anyone have a work around for moving plain text data with some written html into body html without loosing the line break information?
Solved! Go to the solution
This is an accepted solution.
Hi @LottieKing
Renars here from Matrixify app. Thank you for using our app for this task and mentioning it here.
Found one solution which would be to use the Excel SUBSTITUTE formula to bulk replace the line breaks in the text with HTML `<br>` tags.
An example of the process could look like this:
Then you can use this within the Body HTML column to add the value to the description but without line breaks.
Hope this helps!
The only way I know of doing this for large amount of texts is via this tool:
https://www.gillmeister-software.com/online-tools/text/remove-line-breaks.aspx
However, I don't think that'll work great for bulk editing products. When you do the original export via Matrixify, to get all of the metafields in a spreadsheet, you'd probably have to do a bunch of copy and pasting, where you run one cell at a time, via the link above, then paste the results back into the respective cell on the sheet. I don't think it'll handle splitting things up based on cells for you.
★ Did my post help? If yes, then please like and accept solution. ★
https://stephens.world
support@stephensworld.ca
This is an accepted solution.
Hi @LottieKing
Renars here from Matrixify app. Thank you for using our app for this task and mentioning it here.
Found one solution which would be to use the Excel SUBSTITUTE formula to bulk replace the line breaks in the text with HTML `<br>` tags.
An example of the process could look like this:
Then you can use this within the Body HTML column to add the value to the description but without line breaks.
Hope this helps!
Thanks Renars, the substitute formula in excel worked perfectly for this. I appreciate the help.
Hi Renars, came across this post as I have a similar issue. I have two different rich text shopify metafields that I need to reformat as an unordered list type. I had previously manually added bullet points but this is not correct hence why I need to change the formatting.
Below is an example of a metafield I manually updated to the correct format:
{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":" Sensorless GPS computer with Glonass\n Simple setup via smartphone with programmable 3-row display\n Bluetooth® enabled for connectivity with popular speed, cadence and heart rate sensors\n Backlight (Night mode)\n Stores up to 80 hours of ride data\n Import ride data to CatEye Cycling™\n Upload ride data to CatEye Atlas™, Strava™ and TrainingPeaks™\n Battery alert of connected sensors\n OF-100 Out-Front Bracket (26-31 mm)"}]}]}
The following is a current (incorrectly) formatted rich text metafield that I need to format:
{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":" Sensorless GPS computer with Glonass\n Simple setup via smartphone with programmable 3-row display\n Bluetooth® enabled for connectivity with popular speed, cadence and heart rate sensors\n Backlight (Night mode)\n Stores up to 80 hours of ride data\n Import ride data to CatEye Cycling™\n Upload ride data to CatEye Atlas™, Strava™ and TrainingPeaks™\n Battery alert of connected sensors\n OF-100 Out-Front Bracket (26-31 mm)"}]}]}
Every sentence that starts with "\n" should be a new line like:
Sensorless GPS computer with Glonass
Simple setup via smartphone with programmable 3-row display
etc...
I've exported the data via matrixify into excel but not sure how to correctly reformat thru excel.
Any help is greatly appreciated!
Hello @morojp82
This is a bit tricky one as rich text field is a JSON code and it would not have such new lines in the code itself. Newlines are expressed in Rich text as "/n" which you already have so the value you have should work already as is.
I copied the incorrect example from your post and it look like this in Shopify Admin, so the values seem to be correct:
Could it be that you might have sent incorrect example for the metafields value that is not correct?
The issue originally is that I didn't correctly format the bullet points as the unordered list type as indicated in the attached screenshot and that caused a display issue in the collapsible block used to display this data.
I double checked and I sent you the wrong example of the correctly formatted metafield.
Here is the desired format that outputs to individual lines w bullet points:
{"type":"root","children":[{"type":"list","listType":"unordered","children":[{"type":"list-item","children":[{"type":"text","value":"Sensorless GPS computer with Glonass"}]},{"type":"list-item","children":[{"type":"text","value":"Simple setup via smartphone with programmable 3-row display"}]},{"type":"list-item","children":[{"type":"text","value":"Bluetooth® enabled for connectivity with popular speed, cadence and heart rate sensors"}]},{"type":"list-item","children":[{"type":"text","value":"Backlight (Night mode)"}]},{"type":"list-item","children":[{"type":"text","value":"Stores up to 80 hours of ride data"}]},{"type":"list-item","children":[{"type":"text","value":"Import ride data to CatEye Cycling™"}]},{"type":"list-item","children":[{"type":"text","value":" Upload ride data to CatEye Atlas™, Strava™ and TrainingPeaks™"}]},{"type":"list-item","children":[{"type":"text","value":"Battery alert of connected sensors"}]},{"type":"list-item","children":[{"type":"text","value":"FlexTight™ universal bracket"}]}]}]}
The incorrect format is below where I had manually added the bullet points:
{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":" • Sensorless GPS computer with Glonass\n • Simple setup via smartphone with programmable 3-row display\n • Bluetooth® enabled for connectivity with popular speed, cadence and heart rate sensors\n • Backlight (Night mode)\n • Stores up to 80 hours of ride data\n • Import ride data to CatEye Cycling™\n • Upload ride data to CatEye Atlas™, Strava™ and TrainingPeaks™\n • Battery alert of connected sensors\n • OF-100 Out-Front Bracket (26-31 mm)"}]}]}
I went ahead and spent yesterday manually updating it thru shopify but it would be great if there was a way I could bulk export and correct formatting issues like this in the future.
Any suggestions?
Thanks! |
As 2024 wraps up, the dropshipping landscape is already shifting towards 2025's trends....
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024