Keyword

Advanced Search

Search Results (Searched for: extra field order)

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
14 Feb 2017 12:44
Replied by Krikor Boghossian on topic How do I make extra fields visible to registered users alone

How do I make extra fields visible to registered users alone

Category: English K2 Community

 $user = JFactory::getUser(); if ($user->guest) { echo "<p>You must login to see the content. I want your email address.</p>"; } else { // PASTE THE TEMPLATE"S CODE FOR EXTRAFIELDS }

As for the actual code which is used for the extrafields you can look at the item.php file's comments in order to identify the block or you can ask your template's provider.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
25 Jan 2017 18:45
Replied by Krikor Boghossian on topic Article Title k2 should go to the URL that I will point out

Article Title k2 should go to the URL that I will point out

Category: English K2 Community

Hello,

You can use extrafields in order to display custom links.
Each extrafield can be rendered in your template overrides in order to replace the default links.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
12 Dec 2016 20:22
Replied by Krikor Boghossian on topic Cat title link to external website

Cat title link to external website

Category: English K2 Community

You can use an extrafield in order to display that link.
You can render a specific extralink based on its alias, github.com/kricore/Advanced-templating-with-K2/blob/master/_inc/cheatsheet.php#L168-L173
  • Jindřich Ekart
  • Jindřich Ekart's Avatar
21 Nov 2016 18:20 - 21 Nov 2016 18:22

K2 Extra Fields - display mutliselect values as images

Category: English K2 Community

I need advice on how to display mutliselect values in K2 Extra Fileds as images/icons.

I want to create in the K2 catalog for clothing, one extra field will be Colors, this extra fied will be mutliselect list - blue, red, yellow, green etc.
I want in frontend view for item in catalog display this colors as images or icons.

I found it in one of the older template nuFashion was something similar already solved:
https://www.joomlaworks.net/support/templates/commercial-templates/item/221-nufashion

Depending on the color name it was applied in the multiselect list, a class was added for each color name.

For example, for the color White, the CSS added is:
div.itemExtraFields ul li span.itemExtraFieldsValue span.White { background: #FFFFFF; border:1px solid #C6B299; margin: 0 5px 0 0; }

There is item view for catalog in nuFashion template, colors are display as images:
www.joomlaworks.net/images//template/documentation/galleries/nuFashion/nuFashion_03a_ItemCatalogStructure.png


Can you help me?
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
14 Nov 2016 16:21
Replied by Krikor Boghossian on topic How to fetch specific extra field selected val

How to fetch specific extra field selected val

Category: English K2 Community

Hello there,

The syntax in the administrator template is a bit different.
$this->row->extra_fields;
is being used.

Depending on the PHP version some str_replace might be needed in order to use json_decode.

Use this snippet as a starting point.
 <?php if($this->row->id): ?> <?php $extra_fields = str_replace('&quot;', '"', $this->row->extra_fields); ?> <?php var_dump(json_decode($extra_fields)); ?> <?php endif; ?>
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
11 Nov 2016 12:32
Replied by Krikor Boghossian on topic Embed MP3 Player in Item using Extra Fields (No AllVideo)

Embed MP3 Player in Item using Extra Fields (No AllVideo)

Category: English K2 Community

The extrafield part is pretty much straightforward and you can render them where you want in the template.
This goes for the pdf link (could use an editor there like JCE in order to populate the link easier) and the additional text ,should you need any.

However for the mp3 you will need an additional extension like AllVideos, although to be fair the entire functionality is already there under the media tab.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
31 Oct 2016 12:03
Replied by Krikor Boghossian on topic K2 Items ordering in front end?

K2 Items ordering in front end?

Category: English K2 Community

Hello,

You will need a 3rd party extension (can't remember a name) in order to add extra field ordering.

The select box can be populated with menu links which have different ordering settings.
  • Panagiotis
  • Panagiotis's Avatar
27 Oct 2016 17:39 - 27 Oct 2016 17:44
K2 Items ordering in front end? was created by Panagiotis

K2 Items ordering in front end?

Category: English K2 Community

I want to add a drop down box in my page, so that the user will select the items' ordering.
e.g he will choose ordering by name, width, color (width & color will be extra fields which I will add) and th items will be ordered by the user 's choice.

Here for example, you can choose Sort By: Best Selling, Product, New etc.

How can I do this with k2?
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
24 Oct 2016 14:29
Replied by Krikor Boghossian on topic Dropdown Extra Field and "loadposition" plugin

Dropdown Extra Field and "loadposition" plugin

Category: English K2 Community

Hello,

You will need to manually trigger content modules in order for this to work.
docs.joomla.org/Triggering_content_plugins_in_your_extension
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
19 Oct 2016 12:45
Replied by Krikor Boghossian on topic articles ordering by extra fields date value

articles ordering by extra fields date value

Category: English K2 Community

You should always keep a backup of the model, since it will be replaced when you update K2.
  • Jerzy Z Gierzy
  • Jerzy Z Gierzy's Avatar
18 Oct 2016 17:44
Replied by Jerzy Z Gierzy on topic articles ordering by extra fields date value

articles ordering by extra fields date value

Category: English K2 Community

I got this working as desired.
I edited /components/com_k2/models/itemlist.php.
At the end of getData function i decided to sort items as soon as they come from the database.
Starting on line 361:
$rows = $db->loadObjectList(); $dateNow = date('Y-m-d'); $futureItems = array(); $archiveItems = array(); foreach($rows as $row){ $extraFieldsById = array(); $extraFieldsDecoded = json_decode($row->extra_fields, true); foreach ($extraFieldsDecoded as $field){ $extraFieldsById[$field['id']] = $field['value']; } //in our case extra field with end date has id=33 $row->{'dateValueFromEF'} = $extraFieldsById[33]; if($extraFieldsById[33] >= $dateNow){ $futureItems[]= $row; } else { $archiveItems[] = $row; } } usort($futureItems, function($a, $b){ return strcmp($a->dateValueFromEF, $b->dateValueFromEF); }); usort($archiveItems, function($a, $b){ return strcmp($a->dateValueFromEF, $b->dateValueFromEF); }); $rows = array_merge($futureItems, $archiveItems); return $rows;

the code still has to be improved to consider various categories and items without end date extra field, but hopefully its a starting point for someone else with similar situation.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
18 Oct 2016 13:32
Replied by Krikor Boghossian on topic articles ordering by extra fields date value

articles ordering by extra fields date value

Category: English K2 Community

Not at Paul!
Kudos for your extension :)
  • Paul Adamson
  • Paul Adamson's Avatar
18 Oct 2016 06:52
Replied by Paul Adamson on topic articles ordering by extra fields date value

articles ordering by extra fields date value

Category: English K2 Community

Hi, I have written a K2 plugin to implement this and I'm looking for testers. If you like, contact me at This email address is being protected from spambots. You need JavaScript enabled to view it. and we can discuss.

Sorry if I've broken any forum rules.

Cheers
Paul
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
17 Oct 2016 18:35
Replied by Krikor Boghossian on topic articles ordering by extra fields date value

articles ordering by extra fields date value

Category: English K2 Community

Hello,

You will need a 3rd party extension in order to achieve this.
However, I cannot recall a specific one.
  • Jerzy Z Gierzy
  • Jerzy Z Gierzy's Avatar
17 Oct 2016 15:53
articles ordering by extra fields date value was created by Jerzy Z Gierzy

articles ordering by extra fields date value

Category: English K2 Community

Hello
We use k2 items with various extra fields, some of which are date values ( such as event start or event end). I'm trying to alter the display of k2 items so they get sorted by k2 extra field date value, so item which
$item->extraFields->EVENT_END_ALIAS->value < $dateNow
display at the bottom of category .
I think i should create two arrays - one for regular items and one for archive items and then display one and the other into the template (with some additional 'archive' class).
Can this be acomplished with K2 at all?
K2 date fields values are already formated when they reach the template. How can i get an easy to parse date format?
At what point in the code is the best place for item sorting?
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
10 Oct 2016 16:16
Replied by Krikor Boghossian on topic Extra field with time

Extra field with time

Category: English K2 Community

Hello,

You can add a text extrafield in order to display the start/ end time.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
12 Sep 2016 12:38
Replied by Krikor Boghossian on topic Module K2 Content filter items with specific extrafield

Module K2 Content filter items with specific extrafield

Category: English K2 Community

By default the limit from the module's settings will be shown.
This means the module will always pull x items, regardless of their extrafields.

In order to apply certain filters and pull only x items which have a specific extrafield, you need a 3rd part extension.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
07 Sep 2016 18:14
Replied by Krikor Boghossian on topic Cant render extrafield in category item view

Cant render extrafield in category item view

Category: English K2 Community

It should be an Array and not a string.
You can use json_encode() php.net/manual/en/function.json-decode.php in order to convert it into an array so you can directly print data based on the id's position.

Are you using the default template or an override?
  • Artonezero Limited
  • Artonezero Limited's Avatar
06 Sep 2016 19:53
Replied by Artonezero Limited on topic Cant render extrafield in category item view

Cant render extrafield in category item view

Category: English K2 Community

If i add that line of code to the item.php file i get the following:
array(10) { [0]=> object(stdClass)#605 (8) { ["id"]=> string(1) "1" ["name"]=> string(6) "Length" ["value"]=> string(14) "10' 3" - 3.11m" ["type"]=> string(9) "textfield" ["group"]=> string(1) "1" ["published"]=> string(1) "1" ["ordering"]=> string(1) "1" ["alias"]=> string(6) "length" } [1]=> object(stdClass)#604 (8) { ["id"]=> string(1) "2" ["name"]=> string(4) "Beam" ["value"]=> string(13) "4' 0" - 1.22m" ["type"]=> string(9) "textfield" ["group"]=> string(1) "1" ["published"]=> string(1) "1" ["ordering"]=> string(1) "2" ["alias"]=> string(4) "Beam" } [2]=> object(stdClass)#651 (8) { ["id"]=> string(1) "3" ["name"]=> string(5) "Draft" ["value"]=> string(1) "-" ["type"]=> string(9) "textfield" ["group"]=> string(1) "1" ["published"]=> string(1) "1" ["ordering"]=> string(1) "3" ["alias"]=> string(5) "Draft" } [3]=> object(stdClass)#652 (8) { ["id"]=> string(1) "4" ["name"]=> string(11) "Weight (kg)" ["value"]=> string(2) "45" ["type"]=> string(9) "textfield" ["group"]=> string(1) "1" ["published"]=> string(1) "1" ["ordering"]=> string(1) "4" ["alias"]=> string(8) "weightkg" } [4]=> object(stdClass)#653 (8) { ["id"]=> string(1) "5" ["name"]=> string(9) "Sail Area" ["value"]=> string(19) "54 sq ft - 5.2 sq m" ["type"]=> string(9) "textfield" ["group"]=> string(1) "1" ["published"]=> string(1) "1" ["ordering"]=> string(1) "5" ["alias"]=> string(8) "SailArea" } [5]=> object(stdClass)#654 (8) { ["id"]=> string(1) "6" ["name"]=> string(24) "Time to build (estimate)" ["value"]=> string(13) "150-220 hours" ["type"]=> string(9) "textfield" ["group"]=> string(1) "1" ["published"]=> string(1) "1" ["ordering"]=> string(1) "6" ["alias"]=> string(19) "Timetobuildestimate" } [6]=> object(stdClass)#655 (11) { ["id"]=> string(1) "7" ["name"]=> string(24) "Suggested Hardware Lists" ["value"]=> string(41) "Suggested Hardware Lists" ["type"]=> string(4) "link" ["group"]=> string(1) "1" ["published"]=> string(1) "1" ["ordering"]=> string(1) "7" ["url"]=> string(1) "#" ["text"]=> string(24) "Suggested Hardware Lists" ["attributes"]=> string(0) "" ["alias"]=> string(21) "SuggstedHardwareLists" } [7]=> object(stdClass)#656 (11) { ["id"]=> string(1) "8" ["name"]=> string(12) "Buy the plan" ["value"]=> string(29) "Buy the plan" ["type"]=> string(4) "link" ["group"]=> string(1) "1" ["published"]=> string(1) "1" ["ordering"]=> string(1) "8" ["url"]=> string(1) "#" ["text"]=> string(12) "Buy the plan" ["attributes"]=> string(0) "" ["alias"]=> string(10) "Buytheplan" } [8]=> object(stdClass)#657 (11) { ["id"]=> string(1) "9" ["name"]=> string(21) "Download a study plan" ["value"]=> string(38) "Download a study plan" ["type"]=> string(4) "link" ["group"]=> string(1) "1" ["published"]=> string(1) "1" ["ordering"]=> string(1) "9" ["url"]=> string(1) "#" ["text"]=> string(21) "Download a study plan" ["attributes"]=> string(0) "" ["alias"]=> string(18) "Downloadastudyplan" } [9]=> object(stdClass)#658 (11) { ["id"]=> string(2) "10" ["name"]=> string(16) "Buy a study plan" ["value"]=> string(33) "Buy a study plan" ["type"]=> string(4) "link" ["group"]=> string(1) "1" ["published"]=> string(1) "1" ["ordering"]=> string(2) "10" ["url"]=> string(1) "#" ["text"]=> string(16) "Buy a study plan" ["attributes"]=> string(0) "" ["alias"]=> string(13) "Buyastudyplan" } }
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
06 Sep 2016 19:00
Replied by Krikor Boghossian on topic Background Image changing for every Product detailed page

Background Image changing for every Product detailed page

Category: English K2 Community

K2 is free, has been and will be free.
What did you pay exactly?

The plugin unfortunately has to be a custom K2 plugin.
You can find an example here getk2.org/extend/extensions/90-example-k2-plugin-for-developers

Alternatively you can use jQuery's data() function api.jquery.com/data/ in order to populate the data of an extrafield - github.com/kricore/Advanced-templating-with-K2/blob/master/_inc/cheatsheet.php#L104-L109 in order to grab the image's URL and use it to create an inline CSS rule.
Displaying 61 - 80 out of 529 results.

Powered by Kunena Forum