Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2011-01-16 11:44:15
- leafy_loader
- Member
- Registered: 2008-09-25
- Posts: 96
Plugin creation basics
I’m teaching myself how to create a plugin (clientside). To start with I just need to know how to echo a message but wether I use return or echo the message appears just after the <body> tag which is no good to me.
Where am I going wrong? I’m placing my new txp tag within the markup I want it to appear in but with no luck
Offline
#2 2011-01-16 12:01:08
- leafy_loader
- Member
- Registered: 2008-09-25
- Posts: 96
Re: Plugin creation basics
Update:
The problem seems to occur only on the home (default) page
Offline
Re: Plugin creation basics
function llo_world($atts, $thing = NULL)
{
extract(lAtts(array(
'name' => '',
), $atts));
// Tag contents take precedence over name attribute $name = $thing ? $thing : $name;
// no output unless name is provided
return $name ? ‘Hello, ‘ . $name . ‘!’ : ‘’;
}
That’s for a dual-mode (single or container) tag; for a single-tag-mode only version you don’t need to include $thing
in the function signature. Using the new tag:
<txp:llo_world>leafy_loader</txp:llo_world>
<txp:llo_world name="leafy_loader" />
Code is topiary
Offline
Re: Plugin creation basics
Could you post the code you are using?
Some docs:
- Plugin Development Guidelines
- Creating Plugin Help Guidelines
- Plugin basics
- Reserved Plugin prefixes
- Plugin template
Edit. Very cool example Jeff ;-)
Last edited by Gocom (2011-01-16 12:41:32)
Offline
#5 2011-01-16 14:18:25
- leafy_loader
- Member
- Registered: 2008-09-25
- Posts: 96
Re: Plugin creation basics
Thanks for the responses. The problem has ‘magically’ disappeared. I think it may have been a cache issue.
Offline
Pages: 1