Here is my plugin pseudo-code:
class myPlugin
{
var foo = '';
myPlugin()
{
foo = 'bar';
}
function method1()
{
echo $foo;
}
function method2()
{
echo $foo;
}
}
And my template code:
{exp:myPlugin:method1}
...
{exp:myPlugin:method2}
...
{/exp:myPlugin:method2}
...
{/exp:myPlugin:method1}
The method2 call will print out nothing, instead of ‘foo’. Is that intentional?
This is the offending line:
<a href="http://{path=gallery/index}">Gallery Home</a> <b>›</b> {exp:gallery_categoree:parent_category}<a href="http://{path=gallery/cat}{parent_name}">{parent_name}</a> <b>›</b> {cat_name}{/exp:gallery_categoree:parent_category}
I will attach both the plugin and the template file.
Was I right about the plugin not being called?
I don’t think you were right, but maybe I am reading the log incorrectly:
(0.506711) Calling Class/Method: Gallery_categoree/parent_category
(0.506865) -> Class Called: Gallery_categoree
(0.527692) -> Method Called: parent_category
(0.530037) -> Data Returned
Should I attached the entire log?
First, make a reduction template with the most basic example, akin to your original post in this thread. Just those two tags, and the only line of tagdata being the one you are calling the nested plugin. Then please post the template and the parsing log for that reduction test.
Template:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
{embed="common/html-head"}
<style type='text/css' media='screen'>@import "{stylesheet=gallery/gallery_css}";</style>
</head>
<body>
<div id="wrapper">
{embed="common/header"}
<div id="content-wrapper">
{exp:gallery_categoree:categories gallery="{gallery_name}" parse="inward"}
<div id="content">
<h3 class="gallery-breadcrumb">
<a href="http://{path=gallery/index}">Gallery Home</a> <b>›</b> {exp:gallery_categoree:parent_category}<a href="http://{path=gallery/cat}{parent_name}">{parent_name}</a> <b>›</b> {cat_name}{/exp:gallery_categoree:parent_category}
</h3>
</div> <!-- content -->
{/exp:gallery_categoree:categories}
</div> <!-- content-wrapper -->
</div> <!-- wrapper -->
</body>
</html>
Debug log attached.
Let’s reduce this further, okay? Eliminate all noise - you don’t need markup, and you don’t need embeds. In this code below, identify which variables are parsed by which tag, and what the unexpected behavior is.
{exp:gallery_categoree:categories gallery="{gallery_name}" parse="inward"}
{exp:gallery_categoree:parent_category}
{parent_name}
{cat_name}
{/exp:gallery_categoree:parent_category}
{/exp:gallery_categoree:categories}
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.