Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-02-14 02:16:58

piyashrija
Member
Registered: 2012-05-17
Posts: 30

Basic plugin development Problem

Hi

I am trying learn basic of creating enclosing plugin


function function1($atts, $thing = '')
{
extract(lAtts(array(
	'name'=>' '
),$atts));
print_r($thing)(output nothing)	
}
function fuction2($atts){
extract(lAtts(array(
	'name'=>' '
),$atts));
}

In Front end

<txp:function1 name="contact" >
      <txp:function2 name="test"/>
     </txp:function1>

Problem: No response from function2.

I guess it coz i have very low understanding of txt plugin

any help

thanks

Last edited by piyashrija (2013-02-14 02:17:57)

Offline

#2 2013-02-14 02:54:22

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,306

Re: Basic plugin development Problem

piyashrija wrote:

fuction2

I’d start here: function2.


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#3 2013-02-14 04:31:57

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Basic plugin development Problem

Start by taking a look at Extending Textpattern articles. Particularly in your case, if you wish to execute ‘enclosed’ tags, you would have to parse the contents supplied to your tag function through $thing argument. Parsing is normally done with parse() and EvalElse() functions. Tag functions then return their results opposed to outputting.

If you are not familiar with PHP, learning basics beforehand wouldn’t hurt. As tag functions go, there is very little Textpattern in Textpattern. Tags are just functions that given two arguments, other containing an array representing the supplied tag attributes and other the contained statement. Rest is up to tag function. Just normal everyday PHP. I would advice taking a peek at the core functions and how they do things. You can find some in the textpattern/publish/taghandlers.php file.

Last edited by Gocom (2013-02-14 04:33:21)

Offline

Board footer

Powered by FluxBB