Keyword

How to call different php file for k2 categories

  • Shiv240
  • Shiv240's Avatar Topic Author
  • Offline
  • New Member
More
11 years 3 months ago #109421 by Shiv240
Hello all,
i am new to k2. It is a must component for every site. But i just wanted to know that how can we call a different php file for a particular k2 category. for eg: i have 5 categories, 4 are coming through the default file (for k2) and for the last category, i want it to come in a different way. So, how can i customize this in a way that rest 4 categories are not affected and the last one also comes in the way i want!!!

Thanks

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

More
11 years 3 months ago #109422 by william white
Replied by william white on topic Re: How to call different php file for k2 categories

i want it to come in a different way.

Please be more specific in what you mean by come in.
If you are trying to have the display of a single k2 cateogry look different, consider using a k2 override, also called k2 template. Check the documentation links above for paths, and also the videos from ostraining, and you may find the answer your looking for. If not, please elaborate on what you mean by come in and also state the versions of k2 and joomla you are using

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

  • Shiv240
  • Shiv240's Avatar Topic Author
  • Offline
  • New Member
More
11 years 3 months ago #109423 by Shiv240
Thank you William White, for such a quick response.
i read the documentation. it is very interesting. but after reading, i have a question that how k2 will recognize that where to go, as in
-> head for /components/com_k2/templates/ OR
->/templates/YOURJOOMLATEMPLATE/html/com_k2/

Sorry if i sound very basic.

Thanks

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

More
11 years 3 months ago #109424 by william white

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

More
11 years 3 months ago #109425 by STEPHAN HERBY
Replied by STEPHAN HERBY on topic Re: How to call different php file for k2 categories
Hi Shiv,
just to complete William answer and to be more accurate if i had well understood your question...
K2 will recognize wich template to show just because you specifie it in the category parameter. So if you build a specific template for this category (in templates/yourtemplate/html/com_k2) and choose it in category pamameters (on right column), it will print this category with this template... As simple as this :-)

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

  • Shiv240
  • Shiv240's Avatar Topic Author
  • Offline
  • New Member
More
11 years 3 months ago #109426 by Shiv240
Thanks Stéphan Herby..
just last question.. so the category name and the folder name in templates/yourtemplate/html/com_k2
should be same??? am i right??

Thanks

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

  • Shiv240
  • Shiv240's Avatar Topic Author
  • Offline
  • New Member
More
11 years 3 months ago #109427 by Shiv240
hello

I am about to reach my answer.. can any body help me in the answer??


Thanks

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

  • Shiv240
  • Shiv240's Avatar Topic Author
  • Offline
  • New Member
More
11 years 3 months ago #109428 by Shiv240
www.ostraining.com/courses/session/joomla-25/k2/advanced/templates?subcate_id=21

found this link.. and it really helped.. simple !!!

Thanks.

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


Powered by Kunena Forum