Keyword

PHP code in K2 items

  • Alberto Castillo
  • Alberto Castillo's Avatar Topic Author
  • Offline
  • New Member
More
11 years 10 months ago #106905 by Alberto Castillo
PHP code in K2 items was created by Alberto Castillo
Hi

I've tried to add some PHP code inside K2 items but it doesn't seem to run. Is this possible?

Thank you.

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

More
11 years 10 months ago #106906 by william white
Replied by william white on topic Re: PHP code in K2 items
When using php code in k2 items you should create an override and edit the proper file in the override,
category.php
category_item.php
or
item.php are the most common

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

  • Alberto Castillo
  • Alberto Castillo's Avatar Topic Author
  • Offline
  • New Member
More
11 years 10 months ago #106907 by Alberto Castillo
Replied by Alberto Castillo on topic Re: PHP code in K2 items
Thank you WIlliam for all your help thru all my posts

I've seen the override videos, however, is there more documentation regarding this? Can the code be item specific?

In fact it seems there's not so much documentation about K2 over all so it makes it harder to do things.

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

More
11 years 10 months ago #106908 by william white
Replied by william white on topic Re: PHP code in K2 items
As referenced by this post
getk2.org/documentation/tutorials/item/174-templating-with-k2-and-the-concepts-of-sub-templates
a copy of the default folder from components/com_k2/templates/ should be placed in
yourtemplate/html/com_k2/templates.
after that you edit the proper file, item.php for the item view and add your code there
Email me if you need step by step help

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

More
11 years 1 month ago - 11 years 1 month ago #106909 by Anand
Replied by Anand on topic Re: PHP code in K2 items
Hello William,

I have currently working on K2 Module.
For now I have integrate that plugin into my website, all functionality is working file.
But I want to add email functionality after add new item by any user, email goes to admin.


Thanks in Advance.

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


Powered by Kunena Forum