Keyword

get k2 category id in front

More
12 years 2 months ago #101253 by Makis
get k2 category id in front was created by Makis
Hello to all!

My template is from Gavick!

I would like to get K2 category id in my php pages which are in the layout folder inside the template folder!

Layout folder includes all php blocks pages!

Thnk u all

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

More
12 years 2 months ago #101254 by Lefteris
Replied by Lefteris on topic Re: get k2 category id in front
Hi. I cannot think a reason for doing this... But since you want, if you are viewing a single category just use:
JRequest::getInt('id')

Note that this only works when you are viewing a single category in K2.

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

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

More
12 years 1 month ago #101255 by Fabio Almeida
Replied by Fabio Almeida on topic Re: get k2 category id in front

Lefteris Kavadas wrote: Hi. I cannot think a reason for doing this... But since you want, if you are viewing a single category just use:

JRequest::getInt('id')

Note that this only works when you are viewing a single category in K2.



This was very usefull stuff, cause sometimes we don't agree with what designers do but we have to do it, anyway.

My problem was:
I'm creating an Artist management website, and on each artist they want me to display a number of events where they are going to be, with dates and name. So I used related content (Module) to do this so the thing is I need to check view and catid. So this module only displays on item view and on this specific categories.

I hope you could write down the documentation for all jvars involved on k2 they can be very, very usefull.

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

More
12 years 4 weeks ago #101256 by Lefteris
Replied by Lefteris on topic Re: get k2 category id in front
Keep in mind that checking URL paramaters is not a good practice. If user enables the cache for the module then your code will run only once. Then the rest pages will display the cached copy of the module.

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