Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-07-28 09:29:55

monn
New Member
From: Indonesia
Registered: 2006-07-28
Posts: 2
Website

Inserting code snippet

Hello, I’m a new user of textpattern and have not much experience in blogging world. Sorry for these silly questions.

How do I write code snippet in my post?
For example, I want to write a tutorial about PHP and need to insert some code into the article. How do I do this?
Is it also possible to use syntax highlighter in Textpattern? How can I achieve this?


textpattern nubie

Offline

#2 2006-07-28 09:57:46

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Inserting code snippet

Offline

#3 2006-07-28 11:03:37

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: Inserting code snippet

For non-highlighted code, you can use the following:

<pre>
&lt;pre&gt;&lt;code&gt; echo $foo;
&lt;/code&gt;&lt;/pre&gt;
</pre>

You can also insert &lt;notextile&gt; inside the tags. Of course you can use samp and var in place of code, or leave out code altogether.

Also, if you end up with del inside your code, you need to use the HTML entity for hyphens, -.

Last edited by deldindesign (2006-07-28 11:05:11)

Offline

#4 2006-07-28 12:22:14

monn
New Member
From: Indonesia
Registered: 2006-07-28
Posts: 2
Website

Re: Inserting code snippet

Thanks for the help.


textpattern nubie

Offline

Board footer

Powered by FluxBB