Keyword

Call a plugin in K2 item template

  • anothervista
  • anothervista's Avatar Topic Author
  • Offline
  • New Member
More
11 years 10 months ago #106442 by anothervista
Call a plugin in K2 item template was created by anothervista
Hi,
I used josdewplayer in K2 content Item and it works fine. :) also use code
{play}mymp3file.mp3{/play} as a extra field it's working also.
but now I have a question
I have a website with more than 1000 MP3 files and want use {play}mymp3file.mp3{/play} code into k2 Item template and just call file name from extra field . I used this code:
if($extraField->name === "SN" && $this->user->guest){ echo '
{play}',$extraField->value,'.MP3{/play}'; } but file not load and just show the code.
is it any function need to add in K2 Item template file to call josdewplayer plugin?
Some plugin load in this way but josdewplayer not loaded :(

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

More
11 years 10 months ago #106443 by william white
Replied by william white on topic Re: Call a plugin in K2 item template
You should be able to craft php code to reference the extrafield value and insert your tag into the k2 template.
If you are using category view you would edit category_item.php and if you are using the item view you would use item.php
All of the above should be done in an override of K2
In upcoming versions of k2 i have read that there will be a way to directly reference the extra field value. For now you may have to put them into an array and call the array elements value that you need

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


Powered by Kunena Forum