We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

"random" characters being passed to plugin

Development and Programming

matrixgroup's avatar
matrixgroup
15 posts
15 years ago
matrixgroup's avatar matrixgroup

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?

       
Stephen Rushing's avatar
Stephen Rushing
40 posts
15 years ago
Stephen Rushing's avatar Stephen Rushing

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.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.