Keyword

List of all values for specific extra field name

  • Kelsey Brookes
  • Kelsey Brookes's Avatar Topic Author
  • Offline
  • Elite Member
More
11 years 8 months ago #109888 by Kelsey Brookes
List of all values for specific extra field name was created by Kelsey Brookes
I know that I can call the following in a foreach loop:

$item->extraFields->EXTRAFIELDNAMEALIAS->value;

But this repeats the values for each $item they're applied to.

What I really need is to generate a list of all individual values from a specific extra field.

Any clues how I could achieve this?

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

More
11 years 7 months ago - 11 years 7 months ago #109889 by william white
Replied by william white on topic Re: List of all values for specific extra field name
When in the item view...the extra fields are for one item
When in the category view ... the xtra fields are for each item.
You could create a list of all the values of a single extra field by overridign category_item.php and customizing it to show the value of the xtra field in question, in a list format.
If you are wanting to use this in conjuction with and item view that is in the content area i would suggest that you use mod_k2_content to do or k2 split content to try to achieve the same thing in their respective overrides in a module position

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

  • Kelsey Brookes
  • Kelsey Brookes's Avatar Topic Author
  • Offline
  • Elite Member
More
11 years 7 months ago #109890 by Kelsey Brookes
Replied by Kelsey Brookes on topic Re: List of all values for specific extra field name
Thanks William,

I'm trying to override mod_k2_content using items from specified categories.

The goal is to create a list of all values for all items within those categories, but to not have it within the item 'foreach' loop. At the moment it generates individual lists for each item and the values overlap from item to item.

Ideally I just need to output a single list of all possible values contained within the extra field.

K

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


Powered by Kunena Forum