Hi,
I’m writing a plugin, and I want to be able to pass the category belonging to content which is being viewed. I’ve tried several ways all of which pass a string looking like M00o93H7pQ09L8X1t49cHY01Z5j4TT91fGfr
I’ve tried doing this four different ways each having same results:
{exp:my_plugin:events category="{exp:channel:entries}{categories}{category_name},{/categories}{/exp:channel:entries}"}For the following two items I can use the tag {page_categories} else where on the page and will see the actual names of the categories
{preload_replace:page_categories="{exp:channel:entries}{categories}{category_name},{/categories}{/exp:channel:entries}"}
{exp:my_plugin:events category="{my_categories}"}<?php
$categories = "{exp:channel:entries}{categories}{category_name},{/categories}{/exp:channel:entries}";
echo '{preload_replace:page_categories="'.$categories.'"}';
?>
{exp:my_plugin:events category="{my_categories}"}For this last example if i <?php echo $categories;?> anywhere else on the page I get the category names
<?php
$categories = "{exp:channel:entries}{categories}{category_name},{/categories}{/exp:channel:entries}";
?>
{exp:my_plugin:events category="<?php echo $categories;?>"}Does anyone have any ideas why I might be seeing the correct data on the page, but the strange string is being passed to my plugin, or have any other suggestions on how I might achieve the same goal?
I’m having a similar problem, except I’m not trying to use preload_replace. I’m simply using template tags within template tags as parameters. I can output the template tags individually and see the correct value, but not when used as a parameter.
I would think that tags should be infinitely nestable as parameters, assuming the types of quotes are alternated (single within double, and vice versa). I’ve tried every combination of parse=”inward” I can think of, which seems to have no effect.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.