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

Can a plugin treat parameters / tagdata channel-style?

Development and Programming

dsloan's avatar
dsloan
48 posts
16 years ago
dsloan's avatar dsloan

I’ve proved the plugin concept very neatly by writing a simple plugin which interfaces via our own API to an independent application on another server. In this simple example, the application RentPro looks up the requested property id and returns the data item requested, address1 in the example below.

{exp:rentpro property_id='2'}
    address1
{/exp:rentpro}

Now, obviously I’m going to be looking to retrieve more data than this. Is it possible to get the plugin to return an array of property data, and access these data items channel-style, such as below - which is pseudo-code and doesn’t work BTW!

{exp:rentpro property_id='2'}
    The address is {address1} and the town is {town}...
{/exp:rentpro}
       
Greg Aker's avatar
Greg Aker
6,022 posts
16 years ago
Greg Aker's avatar Greg Aker

dsloan,

Yes, this is possible. Are you developing in 1.x or 2.x? You might find looking at the source of the twitter plugin, or really for that matter, any of them might prove to be helpful for you. Then loop through your results and replace variables basend on array keys. (Depending on how the API call retrieves the results).

Hope that helps.

-greg

       

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.