Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-06-07 16:26:39

INIT
New Member
Registered: 2006-06-04
Posts: 2

Tags-within-tags problem

Hello, everybody.
I’m trying to realize toolltips at one of article’s form with ako_boxover plugin
It might look such way:

<code><txp:ako_boxover wraptag=“p”
boxbody=”<ul>
<li><txp:custom_field name=“2”/></li>
<li><txp:custom_field name=“3”/></li>
<li><txp:custom_field name=“4”/></li>
</ul>”
boxheader=“details:”>
<txp:custom_field name=“1”/>
</txp:ako_boxover></code>

but, as written in Txp FAQ

The following will not work:
<code><txp:article_custom section=”<txp:s />” /></code>
If you need to use a dynamic value as a tag attribute, the best way is to call the tag handler function directly, like this:
<code><txp:php>
echo article_custom(
array(‘section’=>$GLOBALS[‘pretext’][‘s’])
);
</txp:php></code>

So, I’m really not prof in php and cant imagine how to rearrange my example in php way.
Could anybody help?
Thanx)

Last edited by INIT (2006-06-07 17:17:49)

Offline

#2 2006-06-07 23:02:32

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

Re: Tags-within-tags problem

<txp:php>

$boxbody = <<<end
<ul>
	<li><txp:custom_field name="2"/></li>
	<li><txp:custom_field name="3"/></li>
	<li><txp:custom_field name="4"/></li>
</ul>
end;

$thing = '<txp:custom_field name="1"/>';

echo ako_boxover(array(
	'boxbody'   => $boxbody,
	'boxheader' => 'details:',
	'wraptag'   => 'p'
), $thing);

</txp:php>

That’s assuming that the plugin in question parses the boxbody attribute for tags, but that may not be the case.

Offline

#3 2006-06-08 02:19:08

INIT
New Member
Registered: 2006-06-04
Posts: 2

Re: Tags-within-tags problem

Mary, thank you for answer.
Yes, it works partially. Tooltip with header appears but this section -<code>
$boxbody = <<<end
<ul>
<li><txp:custom_field name=“2”/></li>
<li><txp:custom_field name=“3”/></li>
<li><txp:custom_field name=“4”/></li>
</ul>
end;</code>
returns only blank ul list without custom_field content in it.
And, even if i use simple variant <code>$boxbody = ‘<txp:custom_field name=“2”/>’;</code> result is same – blank boxbody

Offline

#4 2006-06-08 02:51:16

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

Re: Tags-within-tags problem

Yep, so boxbody isn’t parsed by the plugin (not surprising, it never is in built-in tags, and rarely is for plugins). That’s okay, it just means more code:

<txp:php>

$two = custom_field(array('name' => '2'));
$three = custom_field(array('name' => '3'));
$four = custom_field(array('name' => '4'));

$boxbody = <<<end
<ul>
	<li>$two</li>
	<li>$three</li>
	<li>$four</li>
</ul>
end;

$thing = '<txp:custom_field name="1" />';

echo ako_boxover(array(
	'boxbody'   => $boxbody,
	'boxheader' => 'details:',
	'wraptag'   => 'p'
), $thing);

</txp:php>

Offline

#5 2006-08-02 17:50:09

akokskis
Plugin Author
From: Baltimore-ish, USofA
Registered: 2004-11-28
Posts: 230
Website

Re: Tags-within-tags problem

@INIT
Not quite along the lines of what you’re looking for, but in the latest release, this plugin now supports calling forms for the boxheader and boxbody attributes.

Hope this helps.


My Photoblog, and my personal site. Got nav? ako_nav.
Thanks for taking the time to look…

— vc3 —

Offline

Board footer

Powered by FluxBB