We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Best practice to display code

Development and Programming

Fernando Bernall's avatar
Fernando Bernall
58 posts
15 years ago
Fernando Bernall's avatar Fernando Bernall

I would like to know the best way to display code on an entry for javascript tutorials

I’ve tried the wrapping the code tag around my custom field but it did not work.. I tried the pre tag, no good either.. I have my custom field with none for formatting.

Any guidance would be much appreciated.. thanks..

       
Focus Lab Dev Team's avatar
Focus Lab Dev Team
1,129 posts
15 years ago
Focus Lab Dev Team's avatar Focus Lab Dev Team

You’ll need to be sure you convert your < > { and } tags into HTML entities first. Are you already doing that?

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
15 years ago
Mark Bowen's avatar Mark Bowen

Is using the [ code ]…your code here…[/ code ] tag pair around the text in the entry no good?

Not sure if you’re using ExpressionEngine 1.7.x or 2.x but for version 1 there is an extension which can help with styling all kinds of ode types. Not sure about 2.0 though.

Best wishes,

Mark

P.S. Sorry had to place spaces into the [ code ] [/ code ] tag pair in the example above as the forum was stripping them out.

       
Fernando Bernall's avatar
Fernando Bernall
58 posts
15 years ago
Fernando Bernall's avatar Fernando Bernall

Erik, Mark, thanks for the input.. Yes, it worked once I changed the tags to their entities. I’ll see if the plugin is available.. If not, I’ll make a couple of custom buttons for the editor.. Thanks again..

Fernando

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.