Keyword

Controlling K2 Plugins

  • Quoc Anh
  • Quoc Anh's Avatar Topic Author
  • Offline
  • New Member
More
11 years 10 months ago - 11 years 10 months ago #107187 by Quoc Anh
Controlling K2 Plugins was created by Quoc Anh
I have 2 custom plugins Example1, Example2 and K2mart Plugins. They can be shown in item.php by
<?php echo $this->item->event->K2AfterDisplay; ?>

Now i want to show each plugins on different posittion.
Ex:
- In left column show Example1plugins
- in right column show example2 plugins
- In bottom show k2mart plugins.

How can i do that?
Can i use this
<?php echo $this->item->event->K2AfterDisplay->Example1; ?>
Thanks

Please Log in or Create an account to join the conversation.

More
11 years 10 months ago #107188 by Lefteris
Replied by Lefteris on topic Re: Controlling K2 Plugins
Hi. You cannot do this easily. The only thing you can do is edit the plugins and make them render in a different event ( K2BeforeDisplay for example ) and then move the variable wherever you want.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
11 years 10 months ago #107189 by Lefteris
Replied by Lefteris on topic Re: Controlling K2 Plugins
Alternatively you can pass the output as variables to the item. For example inside your plugin's function:
...
$item->myVar = 'test';
...

And then in your template :
...
echo $item->myVar;

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum