Keyword

SOLVED: PHP if statements based on K2 layout

  • Shannon Briggs
  • Shannon Briggs's Avatar Topic Author
  • Offline
  • New Member
More
6 years 6 months ago - 6 years 6 months ago #164743 by Shannon Briggs
SOLVED: PHP if statements based on K2 layout was created by Shannon Briggs
Hi,

I need to create a PHP conditional IF statement based on the particular K2 layout being used at the time.

For instance - It it is a particular category layout:

If (view="itemlist" && Item="231" ) {
//* do something
}

I just can't get it to work though, and I know I'm missing something super obvious.
Last edit: 6 years 6 months ago by Shannon Briggs.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 6 months ago #164746 by Krikor Boghossian
Replied by Krikor Boghossian on topic PHP if statements based on K2 layout
Take a look how the $view, $task and $id params are being constructed here: github.com/kricore/Advanced-templating-with-K2/blob/master/_inc/cheatsheet.php#L28-L55

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

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

  • Shannon Briggs
  • Shannon Briggs's Avatar Topic Author
  • Offline
  • New Member
More
6 years 6 months ago #164758 by Shannon Briggs
Replied by Shannon Briggs on topic PHP if statements based on K2 layout
Terrific. That's a handy resource that solved the problem, plus has some other cool stuff to try.
Thanks

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 6 months ago #164788 by Krikor Boghossian
Replied by Krikor Boghossian on topic PHP if statements based on K2 layout
You 're welcome :)
Feel free to contribute to the repo if you have any good ideas.

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