Format Code in How To's

Permalink
I wrote my first How To the other day and could not figure out HOW TO (pun intended) format my code snippet. It was a one-liner example so it doesn't really need formatting I suppose but for the future I'd like to know how to do it.

I tried wrapping my code in pre and code tags. Result was "formatted-text" div. I tried using the WMD button, what I saw after clicking that was a print() statement. This confused me to know end. Am I supposed to replace that with the code snippet? Tried that, didn't work. Am I supposed to put the code snippet under it, inside it? Tried every variation I could think of, the best result I could get was having the result be a print() with my code snippet inside. So I gave up on that route.

Hopefully I'm missing something obvious here. Thanks for any answers!

 
enlil replied on at Permalink Reply
enlil
goldhat replied on at Permalink Reply
Well it gives me a hint but not an answer. So you indent the code by minimum 4-spaces. Does that normally work? Didn't work for me. Mine is a PHP snippethttp://www.concrete5.org/documentation/how-tos/developers/get-the-p...

Am I supposed to wrap it in php tags and then convert those tags as Johnthefish suggested?
enlil replied on at Permalink Reply
enlil
yes, it was in regards to this how to:

http://www.concrete5.org/documentation/how-tos/designers/integrate-...

Simply indenting a minimum of 4 spaces before placing the html will put it in the box. As far as php, I'm not sure.
goldhat replied on at Permalink Reply
Thanks, problem was I put the code line on the very first line and I think the spaces get removed. I moved the code after the explanation, problem solved.
JohntheFish replied on at Permalink Reply
JohntheFish
I just checked the howto editor and the problem I describe in
http://www.concrete5.org/developers/pro-accounts/community-leaders-...
remains. At the current state of play, you cant get an opening angle bracket to show in a howto, either by directly inserting the character or by an & l t ; character code.