- Posts: 3
COMMUNITY FORUM
Display Sibling Items in Item.php View
- Steven
-
Topic Author
- Offline
- New Member
Less
More
12 years 3 months ago #109722
by Steven
Display Sibling Items in Item.php View was created by Steven
I would like to display links to all of the other K2 items in the same category when a visitor selects an individual item on our website. This would be similar to the option to display Leading items when a visitor navigates to a specific category.
For example, suppose I had a K2 Category with the following items: Item1, Item2, Item3, and Item4. If a visitor navigates directly to Item1 (where the content would be displayed using the item.php file), I would like to continue to display links to Item2, Item3, and Item4 to allow easy access to these related items.
I'm familiar with using $this->item->nextTitle, but this would only allow for showing the next and previous items instead of all available items in that category. Is there a way to reference all of these items?
Thanks ahead of time for any assistance with this issue.
For example, suppose I had a K2 Category with the following items: Item1, Item2, Item3, and Item4. If a visitor navigates directly to Item1 (where the content would be displayed using the item.php file), I would like to continue to display links to Item2, Item3, and Item4 to allow easy access to these related items.
I'm familiar with using $this->item->nextTitle, but this would only allow for showing the next and previous items instead of all available items in that category. Is there a way to reference all of these items?
Thanks ahead of time for any assistance with this issue.
Please Log in or Create an account to join the conversation.
- jean-philippe
-
- Offline
- Premium Member
- [email protected]
12 years 3 months ago #109723
by jean-philippe
Replied by jean-philippe on topic Re: Display Sibling Items in Item.php View
Hi Steven,
I suppose that you want to use this ?
I suppose that you want to use this ?
Emond, Jean-Philippe
Please Log in or Create an account to join the conversation.
- Steven
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 3
12 years 3 months ago #109724
by Steven
Replied by Steven on topic Re: Display Sibling Items in Item.php View
Thanks!
After adding the same Tag to each of the items in the category, I was able to use the following test code to make them show up:
After adding the same Tag to each of the items in the category, I was able to use the following test code to make them show up:
Log in or Create an account to join the conversation.
- jean-philippe
-
- Offline
- Premium Member
- [email protected]
12 years 3 months ago #109725
by jean-philippe
Replied by jean-philippe on topic Re: Display Sibling Items in Item.php View
Hi Steven,
Sorry after i'm looking the code.. it's not possible (I think) to get Extra_field for RelatedItems...
The array of
Sorry after i'm looking the code.. it's not possible (I think) to get Extra_field for RelatedItems...
The array of
Emond, Jean-Philippe
Please Log in or Create an account to join the conversation.
- Steven
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 3
12 years 3 months ago #109726
by Steven
Replied by Steven on topic Re: Display Sibling Items in Item.php View
So after working with this for a couple of days, I found that I can indeed access the Extra_Fields for individual related items. By using the following code I can print out the Extra_Fields array for each item:
Log in or Create an account to join the conversation.