Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-01-24 01:09:06
- philworks
- New Member
- Registered: 2008-01-24
- Posts: 4
[textile] PRE tag do not react the same way every time
If someone can told me why, I will really appreciate. Thank you
Here is a exemple that will not be generated correctly:
First what you need to know to write a new plugin with the Frog CMS plugin API (Application Program Interface) is that you have enough control to crash the entire Frog CMS application.
To have a flexible application, we need to let do what ever the other person want. This is why we can add PHP directly in pages. On he other way when we wrote a new plugin we need to enforce the security.
Ok! let's start with the basic. The best way to learn is by creating one simple plugin that we will call *The Hello World Plugin*.
1. We need to create our plugin directory "_hello_world_", in the plugins directory
2. We need to create the index.php file in our "_hello_world_" directory
3. We need to set the plugin informations in the index.php, here is the content of index.php
<pre><code>
Plugin::setInfos(array(
'id' => 'hello_world',
'title' => 'Hello world!',
'description' => 'Allows you to display "Hello World! where you want.',
'version' => '1.0',
'website' => 'http://www.madebyfrog.com/')
);
function hello()
{
echo 'Hello World!';
}
</code></pre>
Offline
#2 2008-01-24 01:13:43
- philworks
- New Member
- Registered: 2008-01-24
- Posts: 4
Re: [textile] PRE tag do not react the same way every time
Ok I find it !! it is the empty line in the pre code tags that broke everything.
is there a way to debug this ? or maybe a way to patch it ?
Offline
Re: [textile] PRE tag do not react the same way every time
How ‘bout you use Textile? This post applies to TXP too. Basically: bc..
starts <pre><code>
for you. Type p. That's all folks!
to get out of the code block (or hx. etc).
edit: bookmark this too (it’s linked in the left hand column of the write screen – textile help)
Last edited by jm (2008-01-24 01:31:05)
Offline
#4 2008-01-24 01:37:59
- philworks
- New Member
- Registered: 2008-01-24
- Posts: 4
Re: [textile] PRE tag do not react the same way every time
All the block of code I have post is the good block ;)
but this is the block to test the bug, past it in the link your just send it to me and you will see what I mean.
this is only because of a empty line in a pre-tag. remove this empty line and you will have it generated properly.
Offline
Re: [textile] PRE tag do not react the same way every time
What do you mean by “properly” – what is the intended output? Textile will automatically place a p
element on the pre
line – that’s normal behavior.
By my comment, I meant you should use Textile’s tags instead of direct HTML too.
Last edited by jm (2008-01-24 01:48:34)
Offline
#6 2008-01-24 01:52:05
- philworks
- New Member
- Registered: 2008-01-24
- Posts: 4
Re: [textile] PRE tag do not react the same way every time
ok thanks
Offline