SOLVED: PHP if statements based on K2 layout 1 month 6 days ago #164743

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: 1 month 5 days ago by shannon briggs.
  • Krikor
  • Krikor's Avatar
  • NOW ONLINE
  • Moderator
  • Posts: 14760

PHP if statements based on K2 layout 1 month 6 days ago #164746

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
IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

---
JoomlaWorks
www.joomlaworks.net/

PHP if statements based on K2 layout 1 month 5 days ago #164758

Terrific. That's a handy resource that solved the problem, plus has some other cool stuff to try.
Thanks
  • Krikor
  • Krikor's Avatar
  • NOW ONLINE
  • Moderator
  • Posts: 14760

PHP if statements based on K2 layout 1 month 4 days ago #164788

You 're welcome :)
Feel free to contribute to the repo if you have any good ideas.
IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

---
JoomlaWorks
www.joomlaworks.net/
Moderators: william white

Who Is Online

Total users online: 9 Members and 4295 Guests Online
Alex Walker Alexandre Max Rob L Robert j Wall choowong djsmooth5 pet william white
Legend ::   Site Administrator Global Moderator Moderator Banned User Guest
  • Total Messages: 138539 | Total Subjects: 36480
  • Total Sections: 6 | Total Categories: 32
  • Today Open: 0 | Yesterday Open: 8
  • Today Total Answer: 7 | Yesterday Total Answer: 26
Powered by Kunena Forum