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:
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:
14 years 2 months ago #102317
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
$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
Topic Author
14 years 2 months ago #102318
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
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
13 years 10 months ago #102319
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 :)
Have you found a solution? I've got exact same problem here :(
Please let me know if you've solved it and how :)
13 years 10 months ago #102320
HI
If your using the latest K2 you can use the Extra field alias metthod in both Item & Cat View
If your using the latest K2 you can use the Extra field alias metthod in both Item & Cat View
13 years 10 months ago #102321
Hi Peter
unfortunately this works in item.php but not in category_item.php :(
unfortunately this works in item.php but not in category_item.php :(
13 years 10 months ago #102322
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.
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.
13 years 10 months ago #102323
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?
My Joomla! is 2.5.8 and K2 is v2.6.2 . What about you?
13 years 10 months ago #102324
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.
Finally, be sure that you have the right K2 template in the category you make the changes.
Hope I help you.
13 years 10 months ago #102325
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:
How stupid of me to miss this and search for the solution for hours! :oops:
13 years 6 months ago #102326
I can get it to work in item.php but not in category.php
Here is the post about it from another thread:
getk2.org/community/New-to-K2-Ask-here-first/161714-SOLVED-Tutorial-for-extra-fields#174031
Here is the post about it from another thread:
getk2.org/community/New-to-K2-Ask-here-first/161714-SOLVED-Tutorial-for-extra-fields#174031
13 years 6 months ago #102327
Hello,
You should look at this thread .
Also make sure you are using $this->item or $item-> correctly.
PS. I 'm sure it's a typo but you need to edit category_item.php not category.php for extrafields in category listings.
You should look at this thread .
Also make sure you are using $this->item or $item-> correctly.
PS. I 'm sure it's a typo but you need to edit category_item.php not category.php for extrafields in category listings.
13 years 6 months ago #102328
I will review the other threads.
I have attached a mockup of why I stil think the extrafields need to be in the category.php
I have attached a mockup of why I stil think the extrafields need to be in the category.php
Attachment not found
13 years 6 months ago #102329
They still have to be inside the foreach loop if you want to use them inside category.php.
13 years 6 months ago #102330
Can you help me with the right code?
Here is an example page: 50.116.122.124/~goodwin/xjoomla/index.php/fast-packs
If I put the extrafield code at the bottom of category.php it displays as desired:
But I want it to appear as a header above the list of items. If I paste the same code in this location the extrafield php does not display:
Here is an example page: 50.116.122.124/~goodwin/xjoomla/index.php/fast-packs
If I put the extrafield code at the bottom of category.php it displays as desired:
Attachment not found
But I want it to appear as a header above the list of items. If I paste the same code in this location the extrafield php does not display:
Attachment not found
Log in or create an account to reply.