Hey @PixelGeek, @Waldo (and all the other lovely webflow pros out there)
Maybe you can tell me if this is possible…
Here’s my goal: a CMS blog that shows code examples with styling.
(My preferred style would look like “default” or “desert” on this page Prettify Themes Gallery )
I’m creating a blog that will have multiple dev authors, and I’m trying to come up with an easy solution for them to show their code examples in their tutorial blog posts.
Here’s my vague train of thought on how to do this:
If I…
created a text field in the dev blog CMS collection, (where the blog authors would put their code example)
then in the dev blog template I added an html block and referenced the CMS dev blog text field with the code example (…here’s where I get lost)
could I then use html/css styling in the html block and have it style the code example text?
If you have ideas for alternative ways to accomplish this, OR if you think I’m on the right track… any helpful hints would be appreciated! The more detailed the hints the more appreciated.
Having custom code highlighting in-between other content between rich-text editor field in the CMS could be done as follows:
Code has to be placed between {{CODE}} and {{ENDCODE}} tags, both of which has to be on their own single line (so that we can use script to grab that chunk of text and wrap it with highlighting stuff). Example:
{{CODE}}
This is a test
Nothing to see
{{ENDCODE}}
Example image of how it may look like in the CMS Editor richtext field: