4

So it seems the logic works when the nesting drops back 1 parent, but breaks when the parents drop back two levels or more. After testing this on my end, it looks the depthX_end variables are all fired at the same time in the loop–so you will need a condition to test when the list drops back two parents or more. <ul> {exp:gwcode_categories group_id="3"...


4

Have you created all the necessary files for your add-on? I'm not sure EE will look for your library file in an empty add-on folder. You need to make sure you have an addon.setup.php file at least, and possibly the basic framework for a module I believe for EE to try and load any libraries from your addon. You may need to install said module as well for it ...


3

Your plugin class method needs to return the (parsed) tagdata instead of setting the $this->return_data property. The latter is only needed if the class constructor is used for template output. So: public function testfunction() { return ee()->TMPL->tagdata; }


3

You may be using the incorrect field name. You can't access it via its short name, it has to be by it's field_id. Here is an example of how I do something like this: // these are usually set at the top of my add-on, function, whatever, // for reference through out this PHP file, and also in case different site // instances (staging, dev, whatever) happen ...


1

I believe key should be name of variable. so instead of 0..1..2 it should be and array. Also, parse_variables use for loop. I belive you have single item and loop for sub item (images), You should return parse_variables_row. I have modified code a bit, that should work for you. function item_detail() { $id = ee()->TMPL->fetch_param('id'); $...


1

I have found the answer to this. In the template: {exp:my_class:my_method asin='{product_asin}'} In the class: class My_class { function my_method () { $asin = ee()->TMPL->fetch_param('asin'); return 'my asin is: ' . $asin; } } On the frontend this renders: my asin is: [product asin] So what you have to do is define your ...


1

What you have there you can almost just wrap in a plugin. Start by reading the plugin development docs. However, you can probably simplify your code - and make it more flexible - by instead of building your output markup inside of the plugin, populating an array of data, then returning it to the template, where you use EE variables to create your markup. ...


Only top voted, non community-wiki answers of a minimum length are eligible