Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
k2 から現在のアイテム ID を取得し、それを Cookie に保存したいと考えています。 (もちろん、「現在のアイテム」と書いたときは、k2 テンプレートのアイテム ビューにいます。)
K2 からアイテム ID を取得するにはどうすればよいですか?
試してみ$this->item->idましたが、うまくいかないようです。
$this->item->id
何か案は? ありがとう!
それはあなたがどこにいるかによります。アイテムビューですか?もしそうなら、 $this->item->id はうまくいくはずです。私は何度もそれをしました。
私は@shazに同意します-これは私にとってはうまくいきました(item.phpおよびcategories_item.phpのオーバーライド):
<?php echo $this->item->id; ?>