iilei Posted October 6, 2022 Share Posted October 6, 2022 Hi! I am running a Version 7.0 Template in Developer-Mode on trial. (Newbie alert 😉) Aiming on a dedicated template for a shop offering essential oils, is wish to design a template that takes a string and splits it at a designated character sequence (space+Pipe+space ` | `) . Scenario; { "item" : { "title" : "Mandarin r\u00F6d ekologisk | Citrus reticulata" } } Is it possible to define a regex-based function or a simpler string-split approach so that I can have different ways to represent the title depending on the output channel? For example in the meta tags the pipe character is exactly the desired output and for the product name rendered on the product page the part which comes after the pipe should be rendered with a dedicated css class applied - perhaps also with semantic attributions marking it as the botanical name. Dreaming big: Ideally a helper that invokes gomplate (or just a subset) would allow such freedom of controlling the output. Any ideas how this can be done -- ideally without the need of having JavaScript altering the Output after-the-fact -- would be much appreciated. Thank you Link to comment
iilei Posted October 6, 2022 Author Share Posted October 6, 2022 I decided to use seoTitle for the dedired result Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment