Keyword

Displaying certain Extra Fields on Category Item

  • Gorka Molero
  • Gorka Molero's Avatar Topic Author
  • Offline
  • New Member
More
11 years 8 months ago #102316 by Gorka Molero
Hello Everyone!

I'm trying to display certain specific k2 extra fields on my category_item.php.
I've managed to do it on item.php, following this article , with the following code added to the template override:
Log in  or Create an account to join the conversation.

More
11 years 8 months ago #102317 by william white
Replied by william white on topic Re: Displaying certain Extra Fields on Category Item
try.
$custom = $this->item->extra_fields; and then
echo $custom[1]->value;
in the category_item.php and see if there is a variable confilct of some sort

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

  • Gorka Molero
  • Gorka Molero's Avatar Topic Author
  • Offline
  • New Member
More
11 years 8 months ago #102318 by Gorka Molero
Replied by Gorka Molero on topic Re: Displaying certain Extra Fields on Category Item
Hello William,


Still no luck. The code doesn't work on item.php etither. How can I check if there's a variable conflict going on?

Thanks,

Gorka

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

More
11 years 4 months ago #102319 by Olgri
Hi Gorka

Have you found a solution? I've got exact same problem here :(

Please let me know if you've solved it and how :)

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

More
11 years 4 months ago - 11 years 4 months ago #102320 by Peter Grube
HI

If your using the latest K2 you can use the Extra field alias metthod in both Item & Cat View
Log in  or Create an account to join the conversation.

More
11 years 4 months ago #102321 by Olgri
Hi Peter

unfortunately this works in item.php but not in category_item.php :(

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

More
11 years 4 months ago #102322 by Peter Grube
Hi Olgri,

Strange it's not working for you, it works on both my localhost / wamp server & on my Live site. Here's my cat_item.php overide code the Extra Field Alias is Price.
Log in  or Create an account to join the conversation.

More
11 years 4 months ago #102323 by Olgri
I have just tested it on localhost as well and it's the same as on live site - works in item.php and doesn't work in category_item.php :(

My Joomla! is 2.5.8 and K2 is v2.6.2 . What about you?

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

More
11 years 4 months ago #102324 by Ioannis Gerardis
Replied by Ioannis Gerardis on topic Re: Displaying certain Extra Fields on Category Item
Edit the K2 category and set "show" to the "Extra Fields" in "Item view options in category listings".
Finally, be sure that you have the right K2 template in the category you make the changes.

Hope I help you.

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

More
11 years 4 months ago - 11 years 4 months ago #102325 by Olgri
OMG Gerardis Giannis you are a life saver!!! :cheer: THANK YOU!!!!!!
How stupid of me to miss this and search for the solution for hours! :oops:

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