hmm. none of that worked… parse order problems are such a pain.
Litzinger’s template and snippet select fieldtype chokes when I put any tags in as parameter values (but it does drop in typical template embed variable parameters when they are just strings). I’m actually looking at modding that fieldtype to hook into Stash so I can pass in a stash_var=“stash_var_name” parameter and then have the plug in extract the value, and create an embed variable out of it since when I hardcode the embed variable with a list of category IDs where the template is embedded, this all works like a charm—except the whole hardcoded value thing…
In mod.stash, in the get method, it says: static call within PHP enabled templates or other add-on: <?php echo stash::get(‘title’) ?>
I’ve tried that syntax, but I get a Class doesn’t exist error. This seemed to work
require_once PATH_THIRD . 'stash/mod.stash.php'; $stash = new Stash(); echo $params['stash_var']; //--> returns "current_category_list" echo $stash::get("current_category_list"); //--> returns ""
In the original block above, I added:
<p>Embed:[{embed:current_category_list}]</p> <p>Stash:[{exp:stash:get name="current_category_list"}]</p>
This renders:
Embed:[]
Stash:[16|18]
So, I know the data is in Stash somewhere. and I know the stash var name is getting into the plugin, but I can’t seem to get the value. I’m sure I’m just missing something… any ideas?
|