Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-06-22 02:24:53

tomk
Member
Registered: 2008-05-15
Posts: 12

...use <txp:__> tag from admin side plug-in?

Very basic question that I looked for its answer on the forum, FAQ and other places, and couldn’t understand this:

I’m developing an admin side plug-in, where I’m listing for example articles’ IDs.
Having those ID’s, I want to use the tag <txp:permlink id=“x” /> to link with the article.

This is just an example, but how do I call textpattern’s own tags from inside the <?php / ?> tags?

Thanks in advance, and I’m sorry if this sounds very easy question.

Offline

#2 2008-06-22 02:42:54

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: ...use <txp:__> tag from admin side plug-in?

All Txp tags are PHP functions. Find the function in taghandlers.php and you can see what parameters the specific tag function accepts ($atts is an array of attributes, $thing is a string of the contents of the tag when used as a container).

In the one case you give:

<txp:permlink id="x" />

is

<?php echo permlink(array('id' => 'x')); ?>

Offline

#3 2008-06-22 02:49:36

tomk
Member
Registered: 2008-05-15
Posts: 12

Re: ...use <txp:__> tag from admin side plug-in?

Seems reasonable, but I’m getting the following error.
Should I include taghandles.php? If so, how can I do it without worring about the full location of the file?

Fatal error: Call to undefined function permlink()

I’ve checked the FAQ but I have “txpath” in “config.php” assigned the correct full path of where all textpattern’s folders are (include, lang, lib, publish, etc.).

Last edited by tomk (2008-06-22 03:33:30)

Offline

#4 2008-06-22 05:41:20

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

Re: ...use <txp:__> tag from admin side plug-in?

include_once txpath . '/publish/taghandlers.php';

Last edited by jm (2008-06-22 05:41:32)

Offline

#5 2008-06-22 06:58:51

tomk
Member
Registered: 2008-05-15
Posts: 12

Re: ...use <txp:__> tag from admin side plug-in?

jm wrote:

bc. include_once txpath . ‘/publish/taghandlers.php’;

You’re the greatest, worked like a charm.
Thank’s a lot!

Last edited by tomk (2008-06-22 07:00:25)

Offline

#6 2008-06-22 06:59:39

tomk
Member
Registered: 2008-05-15
Posts: 12

Re: ...use <txp:__> tag from admin side plug-in?

EDIT:
Sorry for double post, this message was posted unpurpose.

Last edited by tomk (2008-06-22 07:01:59)

Offline

#7 2008-06-24 02:28:36

tomk
Member
Registered: 2008-05-15
Posts: 12

Re: ...use <txp:__> tag from admin side plug-in?

jm wrote:

include_once txpath . ‘/publish/taghandlers.php’;

Why would you think that after putting this line in my plug-in, when compiling through command line and importing it, I get the following:

Fatal error: Call to undefined function permlink()

If once installed I manually put the line manually in the plug-in’s code, it’ll work.
Any help?

Last edited by tomk (2008-06-24 03:07:30)

Offline

Board footer

Powered by FluxBB