Hi
I have a very simple plugin that takes a related gallery entry ID and returns the gallery category of the image:
function Gallerycategory()
{
global $TMPL, $DB;
$query = $DB->query("SELECT rel_data FROM exp_relationships WHERE rel_id = '" . $TMPL->fetch_param('relationship_id') . "'");
$row['rel_data'] = $query->row['rel_data'];
if ($reldata = @unserialize($row['rel_data']))
{
$this->return_data = $reldata['query']->result[0]['cat_id'];
}
}
This works fine in a template as follows (I’m passing in the category ID from a parent template):
cat id = {exp:gallerycategory relationship_id='{embed:gallery_category}'}
Results in:
cat id = 5
But when I try to use this in a gallery:entries tag, I get no results:
{exp:gallery:entries gallery="{embed:gallery}" category="{exp:gallerycategory relationship_id='{embed:gallery_category}'}" orderby="date" sort="asc" columns="1" rows="100" log_views="off" dynamic="off"}
Hardcoding the category parameter works fine, so I know there are images in the category.
Do plugins not return their data before the gallery entries are searched?
