Hello!
I have a plugin which collects data from two XML Files which are available on a remote http webseite.
The first remote file is a list of members of our community The second file is the personal date for one member.
What i want to do is the following: 1.) I first want to get a complate list of all members and display them on my homepage 2.) In each row of my table i want to get the member details for each member.
{exp:armory:guild server="xyz" guild="abc"}
<tr>
<td>{guild_member_name}</td>
{exp:armory:character server="xyz" character="{guild_member_name}"}
<td>{member_gender}</td>
<td>{member_location}</td>
<td>{member_age}</td>
{/exp:armory:character}
</tr>
{/exp:armory:guild}
Now this was not working. It worked when i set the parameter character=”Joe” static, but not with character=”{guild_member_name}”. Also if i dont nest, both are working just fine.
I found out that there is a parameter parse=”inward” to parse the outer code first but when i add this parameter to {exp:armory:guild} i just get a blank webpage.
Another Addition… heres my Plugin Code:
class Armory {
function Character() {
global $TMPL;
$server = $TMPL->fetch_param('server');
$character = $TMPL->fetch_param('character');
// Here i do some remote XML Collecting
$tagdata = $TMPL->tagdata;
foreach ($TMPL->var_single as $v) {
if ($v == 'armory_name') $tagdata = $TMPL->swap_var_single($v, RESULTFROMXMLFILE, $tagdata);
...
...
...
}
}
function Guild() {
global $TMPL;
$server = $TMPL->fetch_param('server');
$guild = $TMPL->fetch_param('guild');
$tagdata = $TMPL->tagdata;
for (......) {
$tagdata = $TMPL->swap_var_single('gender', RESULTFROMXMLFILE, $tagdata);
...
...
...
}
}
}
If you get a blank page, it’s generally an indication of hidden PHP errors. Turn error reporting on, make sure display_errors is enabled in your PHP environment, and give it another go. “Inward” parsing is exactly what you need for this type of situation. An alternative would be to make the character details a variable pair of your guild() method, similar to the categories variable pair of the weblog entries tag. Either way, you need to get error reporting on to reveal the issue.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.