- Posts: 4
COMMUNITY FORUM
Displaying certain Extra Fields on Category Item
- Gorka Molero
-
Topic Author
- Offline
- New Member
Less
More
12 years 7 months ago #102316
by Gorka Molero
Displaying certain Extra Fields on Category Item was created 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:
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.
- william white
-
- Offline
- Platinum Member
Less
More
- Posts: 3722
12 years 7 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
$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
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 4
12 years 7 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
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.
- Olgri
-
- Offline
- New Member
Less
More
- Posts: 10
12 years 4 months ago #102319
by Olgri
Replied by Olgri on topic Re: Displaying certain Extra Fields on Category Item
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 :)
Please Log in or Create an account to join the conversation.
- Peter Grube
-
- Offline
- Elite Member
Less
More
- Posts: 241
12 years 4 months ago - 12 years 4 months ago #102320
by Peter Grube
Replied by Peter Grube on topic Re: Displaying certain Extra Fields on Category Item
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
Log in or Create an account to join the conversation.
- Olgri
-
- Offline
- New Member
Less
More
- Posts: 10
12 years 4 months ago #102321
by Olgri
Replied by Olgri on topic Re: Displaying certain Extra Fields on Category Item
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 :(
Please Log in or Create an account to join the conversation.
- Peter Grube
-
- Offline
- Elite Member
Less
More
- Posts: 241
12 years 4 months ago #102322
by Peter Grube
Replied by Peter Grube on topic Re: Displaying certain Extra Fields on Category Item
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.
Log in or Create an account to join the conversation.
- Olgri
-
- Offline
- New Member
Less
More
- Posts: 10
12 years 4 months ago #102323
by Olgri
Replied by Olgri on topic Re: Displaying certain Extra Fields on Category Item
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?
Please Log in or Create an account to join the conversation.
- Ioannis Gerardis
-
- Offline
- New Member
Less
More
- Posts: 1
12 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.
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.
- Olgri
-
- Offline
- New Member
Less
More
- Posts: 10
12 years 4 months ago - 12 years 4 months ago #102325
by Olgri
Replied by Olgri on topic Re: Displaying certain Extra Fields on Category Item
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:
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
- Offline
- Platinum Member
Less
More
- Posts: 404
11 years 11 months ago #102326
by Odin Mayland
Replied by Odin Mayland on topic Re: Displaying certain Extra Fields on Category Item
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
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
11 years 11 months ago #102327
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: Displaying certain Extra Fields on Category Item
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.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
- Offline
- Platinum Member
Less
More
- Posts: 404
11 years 11 months ago - 11 years 11 months ago #102328
by Odin Mayland
Replied by Odin Mayland on topic Re: Displaying certain Extra Fields on Category Item
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
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
11 years 11 months ago #102329
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: Displaying certain Extra Fields on Category Item
They still have to be inside the foreach loop if you want to use them inside category.php.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
- Offline
- Platinum Member
Less
More
- Posts: 404
11 years 11 months ago - 11 years 11 months ago #102330
by Odin Mayland
Replied by Odin Mayland on topic Re: Displaying certain Extra Fields on Category Item
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
Please Log in or Create an account to join the conversation.