2

How can I display all of the sibling items in a parent category on a Joomla! K2 item page? I want all, not just the next and previous. I, also, want to display additional data like the image and extra fields. I realize the category page does this already, but I need it on the individual item pages, too.

Michael Yaeger
  • 756
  • 12
  • 32
  • Is my answer any help for you? If it is, please, accept it, if it's not enough, ask for futher details :) – TeeJay Apr 24 '15 at 11:33

1 Answers1

0

There are two ways, create a plugin or just do it in your item.php template (overriden in your template/html/com_k2/ folder!)

Creating a plugin is the correct way. It requires more effort and and creating a plugin is a deep topic that's been described a thousand times.

The same goal can be reached just by editing the item.php template file, but just be aware that it's not a good practice to connect to the database in a template file. You have to do there the same things as you would do in the plugin except you don't have to create the plugin. You have to access the DB and select your desired data from it. Then, you can just write some HTML where you'll put all the data you want.

These pages might help you with both developing the plugin and editing the template

TeeJay
  • 1,593
  • 3
  • 21
  • 33