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

Plugins using other plugins?

Development and Programming

Tim Stackhouse's avatar
Tim Stackhouse
62 posts
16 years ago
Tim Stackhouse's avatar Tim Stackhouse

A cursory look shows this hasn’t been brought up before, apologies if it has.

I’m working on a custom plugin for my website, and I’d like to use some established code, namely the ImageSizer plugin to process the images I’m getting back. Is there a way to essentially call a plugin from a plugin? This is my first venture into extending EE the “official” way, so any pointers would be great.

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
16 years ago
Lisa Wess's avatar Lisa Wess

Sure, have a look at the parse= parameter to make sure that they are parsed in the order you need them to be.

       
Tim Stackhouse's avatar
Tim Stackhouse
62 posts
16 years ago
Tim Stackhouse's avatar Tim Stackhouse
Sure, have a look at the parse= parameter to make sure that they are parsed in the order you need them to be.

That looks like a step in the right direction, but it looks to be more about nesting different plugin tags, e.g

{exp:magpie url="http://some-site.com" parse="inward"}
   {items}
      <a href="http://{link}">{title}</a>

      {exp:word_limit total="20"}{content}{/exp:word_limit}

   {/items}
{/exp:magpie}

I was thinking something with tighter integration, where I’m directly calling the functionality of the ImageSizer plugin from my plugin code, so I could have something like:

{exp:lastfm:quilt user="tesfox" rows="5" cols="3"}

To use in my templates.

       
Robin Sowell's avatar
Robin Sowell
13,160 posts
16 years ago
Robin Sowell's avatar Robin Sowell

You just need to call the class you need a la

if ( ! class_exists('Class_name'))
{
    require PATH_PI.'pi.class_name'.EXT;
}

Then you’d use the function you need a la

$PLUG = new Class_name;
$PLUG->function();

Er- roughly. Make sense? You can then use the functions from the class you called.

       
Tim Stackhouse's avatar
Tim Stackhouse
62 posts
16 years ago
Tim Stackhouse's avatar Tim Stackhouse

That’s Just what I wanted to hear! I just wasn’t sure how to go about doing it. I’ll be sure to spruce it up and share it here once it’s done. Thanks!

       
Tim Stackhouse's avatar
Tim Stackhouse
62 posts
16 years ago
Tim Stackhouse's avatar Tim Stackhouse

This one might be a little more involved, now that the functions are accessible, how would one pass in data that’s expected via the TMPL class?

       

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.