[EDIT: I was able to answer my question. Answer posted below.]
EE 5.2.4
I have a class that will query an API using item ID and return data for that item.
I am aware that this structure:
{exp:my_class:my_method}
will return the value for this:
class My_class {
function my_method () {
// content
}
}
However, what I need to do is pass an argument to the class method for each entry within a channel, like this:
{exp:channel:entries channel='products'}
{exp:my_class:my_method arguments='{product_asin}'}
{/exp:channel:entries}
would return a value from the class method for each product entry:
class My_class {
function my_method ($asin) {
// query api based on $asin values passed from the template
}
}
It's quite possible I'm missing something in this part in the docs, as they are quite elaborate regarding add-on classes and methods, so I'm hoping someone will just know from experience how to do something like {exp:my_class:my_method arguments='{product_asin}'}
.
Thanks!