Hi all,
For an upcoming project, I have at least two values/properties for items that I need to render as “code” with <pre> tags, because I need to preserve the exact formatting and spacing.
Right now, my idea is to check for these values on the items page in the .phtml file and modify the HTML if the condition applies.
This works just fine, but I’m wondering if there is a better way to do it - maybe a module I am not aware of?
A module could alter the display of certain properties, or offer a different data type or something like that, if that was a road you were interested in going down.
I’m not aware of any modules that would do this for this pre
case specifically, and your theme approach sounds OK to me. You might also be able to do it with just CSS; the “pre” type handling is something that can be applied with styles and doesn’t necessarily require the actual <pre>
element.
1 Like
Thank you very much, I’ll check the CSS route as well! Good to know that editing the theme is a viable option, because it really looks like I can handle most of my “special cases” with a fork of my preferred theme.