so I’m making a plugin that will do a bit of processing on a chunk of data retrieved from one of the weblogs in our EE database. I need to loop through the data to generate some information, which is no problem, but then I need to use that information in two places on the page, separated by a bunch of other content in the source.
What I’m wondering is if there are some tricks that will allow me to reuse the database query and generated information in both places without repeating the query/loop. Basically is there a way to access data that was stored in a class variable with an earlier call to the plugin?
example:
{exp:my_plugin} // query the database, manipulate the data somehow, store it in a class variable, maybe print some stuff
{exp:weblog:entries}
// do whatever
{/exp:weblog:entries}
{exp:my_plugin:do_something} // use the data stored in the class variable from earlier to print more stuff out
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.