Keyword

Advanced Search

Search Results (Searched for: extra field order)

  • JoomlaWorks
  • JoomlaWorks's Avatar
13 Feb 2019 19:39
  • George Nasis
  • George Nasis's Avatar
11 Feb 2019 19:38

Extra Field Drop-down selection add new one but sorting them alphabetically

Category: English K2 Community

Yes of course when it is selected it is indeed static. But I have about 40 options in the drop down that I display to user to choose between them :) So there I have to order them alphabetically.

In extra fields manager I could add an option in the end and transfer with the hand all the values to that direction but it is not working, because for the items that already a value has been assigned will break :)

So the most convienient way without not hacking the core is to add options in the end and then in the table of k2_extra_field to put to the right order

Thank you very much Fotis!

Looking forward of v3
  • George Nasis
  • George Nasis's Avatar
11 Feb 2019 15:18

Extra Field Drop-down selection add new one but sorting them alphabetically

Category: English K2 Community

Hi Fotis,

yes sure it would be an option. Another option that i found is to change the order inside the k2_exta_fields table for he specific values I want. So no hack is required.
  • JoomlaWorks
  • JoomlaWorks's Avatar
11 Feb 2019 00:32

Extra Field Drop-down selection add new one but sorting them alphabetically

Category: English K2 Community

It's possible, but it would require to hack core K2 files to enforce the order you want.
  • JoomlaWorks
  • JoomlaWorks's Avatar
27 Jan 2019 12:01
Replied by JoomlaWorks on topic Problem with Extra Fields Groups

Problem with Extra Fields Groups

Category: English K2 Community

I don't see how these 2 are relevant. Have you installed any other K2 plugins in the meantime? Or change the order in plugins?
  • JoomlaWorks
  • JoomlaWorks's Avatar
09 Jan 2019 15:12
Replied by JoomlaWorks on topic K2 extra fields dans un site multi-langue

K2 extra fields dans un site multi-langue

Category: Communauté française K2

K2 extra fields don't support translating content to other languages at the moment.

There is a trick though you can do.

Create a different set of extra fields for each language. One for each language.

When you assign all these items into an extra field group, they will get loaded in the K2 item form (whose content CAN be translated and assigned to different languages). Then, all you have to do is simply fill in the extra fields of the respective language. E.g. if you're writing the Italian content, fill in the extra fields with Italian labels on them, not the French ones.

Finally, modify the foreach loop where extra fields are rendered, in order to hide empty values. So in item.php, change this (around line 253):
 <?php foreach ($this->item->extra_fields as $key => $extraField): ?> <?php if($extraField->value != ''): ?> <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?> alias<?php echo ucfirst($extraField->alias); ?>"> <?php if($extraField->type == 'header'): ?> <h4 class="itemExtraFieldsHeader"><?php echo $extraField->name; ?></h4> <?php else: ?> <span class="itemExtraFieldsLabel"><?php echo $extraField->name; ?>:</span> <span class="itemExtraFieldsValue"><?php echo $extraField->value; ?></span> <?php endif; ?> </li> <?php endif; ?> <?php endforeach; ?>

to this:
 <?php foreach ($this->item->extra_fields as $key => $extraField): ?> <?php if($extraField->value != ''): ?> <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?> alias<?php echo ucfirst($extraField->alias); ?>"> <?php if($extraField->type == 'header'): ?> <h4 class="itemExtraFieldsHeader"><?php echo $extraField->name; ?></h4> <?php else: ?> <?php if (!empty(trim($extraField->value))): /* Show extra fields with values only! */ ?> <span class="itemExtraFieldsLabel"><?php echo $extraField->name; ?>:</span> <span class="itemExtraFieldsValue"><?php echo $extraField->value; ?></span> <?php endif; ?> <?php endif; ?> </li> <?php endif; ?> <?php endforeach; ?>

Done.
  • Timothy Michel
  • Timothy Michel's Avatar
14 Oct 2018 01:57 - 16 Oct 2018 23:39
Replied by Timothy Michel on topic After Update to K2 2.9 Extra Fields Don't Work At All

After Update to K2 2.9 Extra Fields Don't Work At All

Category: English K2 Community

About CSS Grids, Fotis, I think using CSS Grids makes Reactive Design unnecessary. See the attacked HTML file.

File Attachment:

File Name: grid-test.zip
File Size:3 KB


This took about two hours start to finish. I am amazed at how much this accomplishes with just 130 lines of CSS.

I added a demonstration of how DIVs can be moved around on the page using CSS Grids so the CSS ended up becoming 266 lines instead of 130.

Sub-templating is still very important, however, because even though CSS Grids makes designing a template orders of magnitude easier, not all pages are going to require the same set of DIVs, or the same logic,and that is where sub-templating comes in very handy.
  • Yannick Lämmel
  • Yannick Lämmel's Avatar
08 Oct 2018 18:18

Getting only extraFields Dropdown ID (not Value) in tag.php

Category: English K2 Community

Hi there,

before the K2 2.9 Update i was able to get extraField-Values like this (dropdowns):

$item->extraFields->Ort->value

After the 2.9 Update, im not getting a normal Array with all Values but this:
["extra_fields"]=>
string(890) "[{"id":"3","value":["5"]},{"id":"33","value":["7"]},{"id":"31","value":["2"]},..................

I managed to build a Array i could work with:

$extrafields = json_decode($item->extra_fields, true);
$extrafields = array_combine(array_column($extrafields,'id'),$extrafields);

But since it only gives me the ID of the Dropdown Option (not the Value itself), i cant work with it.
The Values are visible in extra_fields_search, but they are not ordered or anything.

How can i access the Dropdown Values?
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
16 May 2018 21:46

The content of K2 Extra Fields is deleted after frontend editing

Category: English K2 Community

We are working on a fix, you can bookmark our repo in order to stay up to date.
github.com/getk2/k2

Also, thank you for reporting this. Feedback is invaluable to us
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
02 Apr 2018 14:30
Replied by Krikor Boghossian on topic Is it possible to link K2 item title to open another URL

Is it possible to link K2 item title to open another URL

Category: English K2 Community

Hello,

You can use an extrafield in order to replace the default link.
You will need to edit your overrides (category_item.php, tag.php, generic.php etc..)
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

How to render a specific extrafield:
github.com/kricore/Advanced-templating-with-K2/blob/master/_inc/cheatsheet.php#L169-L173
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
02 Apr 2018 14:30
Replied by Krikor Boghossian on topic Is it possible to link K2 item title to open another URL

Is it possible to link K2 item title to open another URL

Category: English K2 Community

Hello,

You can use an extrafield in order to replace the default link.
You will need to edit your overrides (category_item.php, tag.php, generic.php etc..)
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

How to render a specific extrafield:
github.com/kricore/Advanced-templating-with-K2/blob/master/_inc/cheatsheet.php#L169-L173
  • James Argo
  • James Argo's Avatar
12 Mar 2018 16:28

K2 Backend ACL critical problem, user can do restricted action.

Category: English K2 Community

Thank you Krikor and Fotis for replying.

Fotis wrote: In order for an editor in the backend to have access to users, extra fields etc. they MUST have "core.admin" rights assigned to them. In other words, they must share a critical feature available to admins only.

If your plain user can modify content beyond items and categories and comments, make sure they don't have the above permissions when configuring their group.


If you mean by "core.admin" rights is what we have with Joomla ACL as Global Configuration --> Permission --> Author, then I believe I have not assigned them "Access Administration Interface" . But if you mean K2 ACL permission, then I do assign the Author "Access Administration Interface" in K2 ACL permission. Because if I don't assign them in Access Administration Interface of K2 ACL permission, he can not access K2 at back end administrator page at all.

The most simple yet logic solution that comes to my mind is to disable (or hide) the "change author" button and publishing state in K2 item editor for user without publishing right like we have on front end site editor. Well, at least that would prevent the user to "sneak into the hole".

Thank you. :-)
  • JoomlaWorks
  • JoomlaWorks's Avatar
12 Mar 2018 14:11

K2 Backend ACL critical problem, user can do restricted action.

Category: English K2 Community

In order for an editor in the backend to have access to users, extra fields etc. they MUST have "core.admin" rights assigned to them. In other words, they must share a critical feature available to admins only.

If your plain user can modify content beyond items and categories and comments, make sure they don't have the above permissions when configuring their group.
  • James Argo
  • James Argo's Avatar
10 Mar 2018 07:21 - 10 Mar 2018 08:13

K2 Backend ACL critical problem, user can do restricted action.

Category: English K2 Community

Greeting all...

First of all, thank you Joomlaworks for providing us so useful and wonderful extension K2 for free. It is great!

Ok, I just have found a problem which could cause a threat to our site, where user with very limited backend admin access can see, and take action on things they suppose NOT to do. I spent last few days on testing this issue in both local server and also online server. I can confirm this is really potential problem which can destroy the whole K2 articles in our site. To make it short, let's make it this way:

1. Fresh install Joomla 3.8.5.
2. Fresh install K2.
3. No other extension installed.
4. I (as Super User) create Joomla usergroup Author, and new Viewing Access Level called "Author" which includes Public, Registered and Author only (ticked).
5. I create a Joomla user named "author1" which will act as article creator. In Joomla user, I assign this user author1 to usergroup Author. Then import the user to K2 user. His ONLY job is to create K2 articles and edit his OWN articles when necessary via back end and NOT to publish it. To do so, I assign his permission via Joomla ACL as follow :
  • Joomla global ACL, set the group Author to have backend Administrator login. That's it. The rest permission in this point is inherited.
  • Still in Global Configuration, go to K2 permission tab. Set Author permission to allow CREATE and EDIT OWN. *I also have to set Access Administration Interface" to Allowed, in order to make the admin menu toolbar appear to the author while he is login to backend administrator. Otherwise he will not be able to access either component toolbar or any K2 section (panel) in backend administrator.* Save it.
  • Go to admin menu Joomla Extension --> Modules --> Administrator. FInd the module "Toolbar", edit it and grant access to "Author"

If we do it correctly, we can now logout as Super User, and re-login to backend administrator as Author1 with limited view access.

What we see as Author1 in backend administrator Cpanel page is K2 stats (admin) , and K2 Quick Icons (admin) , while in toolbar he can see Components and Help menu. The Components will only have K2 sub menu, * with K2 FULL sub menu instead of only Items, category, tags, comments, media manager, and information! *

That means, using the toolbar this Author1 is able to access many unauthorized resources and take unauthorized action such as disabling any user available (despite their usergroup), and flag them as spammer!

It is true that when he tries to access (for example) the K2 Users page, he will be warned by red error box saying "Error you are not authorized to view this resource", but still the page is open and give him an access to many unauthorized option to take action such as disabling users, and flag users as spammers.

Ok, so what if I don't grant access of module toolbar to Author? Doesn't that mean he is still able to access K2 section via K2 Quick Icons (admin) menu in Cpanel when he logged in and NOT having full K2 menu in toolbar?

Yes... He will not see Component menu in toolbar. Thus he wont have any K2 submenu either. And he still be able to access K2 backend section through K2 Quick Icons (admin). The problem is, there is still a chance for him to easily "sneak" into the hole.

Let's say I don't grant access of module toolbar to Author in admin menu module. This author can access K2 backend section through K2 Quick Icons (admin). What he will see in the left menu are : Items, Categories, Tags, Comments, Media Manager, and Information only. No link to K2, Users, Usergroups, or Extra fields. The problem is, when he create new article (or editing his own) the K2 item editor will open. In this K2 item editor, he CAN change the author by clicking Author button... When he click it, K2 users page will open and again, he will be warned by red error box saying "Error you are not authorized to view this resource", but still the page is open and give him an access to many unauthorized option to take action such as disabling users, and flag users as spammers.



If you don't have any idea what was happening when someone click flag users as spammer to legit site contributors, it is big disaster. All their articles will be destroyed from database, and the user is deleted from K2 database table, the site turns out error 1056 database error etc in front end, etc... Well, at least that was what happen to me last week. The website down for a while. Lucky I got daily backup to restore (Thanks Akeeba!).

I am not sure if this is appropriate, but granting this user "Access Administration Interface" in global K2 permission ACL should not go that far. There should be a way where "Access Administration Interface" permission does not give him way to far access in K2 admin section. Instead, only permission given to him is accessible (like create items and edit his own).


The next thing is, he is able to publish his own article if he manage to edit his own article via backend admin K2 item editor. It is true, that if he goes to Items menu in K2, (where he will see list of articles), he can not click (un-tick) the published checkbox (doing so will not change the state of article) to make it published or unpublished. But if he manage to edit the articles, he is able to change the state of publishing via K2 item editor page (it will take effect after saving).


That's all for now, please bear my English. I hope JW developers can take a look into the problem and solve them in next release.

Thank you so much for all your effort! You guys ROCK!!
  • Andrew Winkler
  • Andrew Winkler's Avatar
09 Mar 2018 02:38 - 09 Mar 2018 02:39
Replied by Andrew Winkler on topic Does K2 allow custom front end "item" submission?

Does K2 allow custom front end "item" submission?

Category: English K2 Community

Above functionality is great, however it still uses the rather Spartanic standard K2 frontend submission form with all the custom fields for the category tucked away in the extra fields tab, not necessarily in the best possible order, and with virtually no formatablity. Especially the multiple choice field needs improvement. I'm looking for a K2 extension/plugin that will allow me to create formatted frontend submission forms that write the content directly to the K2 item table. Ideally, those forms should have conditional fields, depending on what the user entered in a field above, and features such as multiple tabs and accordion to make the form more user friendly.

Even better would be if such extension was also able to design the custom frontend layout template so that admin doesn't need to engage in php coding.
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
13 Feb 2018 22:08
Replied by Krikor Boghossian on topic Using same SIG pro gallery in different K2 items

Using same SIG pro gallery in different K2 items

Category: English K2 Community

Hello and thank you for your interest in our product,

Unfortunately at the current moment each K2 item has a separate gallery.
You can use an extrafield in order to add additional galleries and have common galleries between items.
  • Eddie May
  • Eddie May's Avatar
30 Nov 2017 22:46

DateTime::__construct(): Failed to parse time string (-1-11-

Category: English K2 Community

Hi,

I've had this problem intermittently on K2 items - each time I've resolved by deleting tags on the item, saving & then reapplying tags & saving.

But I'm now getting this on a menu item. The error is as follows:

Oh, dear, we have a 0

DateTime::__construct(): Failed to parse time string (-1-11-30) at position 5 (-): Double timezone specification

The menu is a K2 Categories menu K2 » Item listings » Categories
index.php?option=com_k2&view=itemlist&layout=category&task=category&id=4

Here are the params for this menu item:
{"inheritFrom":"0","catMetaDesc":"","catMetaKey":"","catMetaRobots":"","catMetaAuthor":"Eddie","theme":"","num_leading_items":"2","num_leading_columns":"1","leadingImgSize":"Large","num_primary_items":"4","num_primary_columns":"2","primaryImgSize":"Medium","num_secondary_items":"4","num_secondary_columns":"1","secondaryImgSize":"Small","num_links":"4","num_links_columns":"1","linksImgSize":"XSmall","catCatalogMode":"0","catFeaturedItems":"1","catOrdering":"","catPagination":"2","catPaginationResults":"1","catTitle":"1","catTitleItemCounter":"1","catDescription":"1","catImage":"1","catFeedLink":"0","catFeedIcon":"0","subCategories":"1","subCatColumns":"2","subCatOrdering":"","subCatTitle":"1","subCatTitleItemCounter":"1","subCatDescription":"1","subCatImage":"1","itemImageXS":"","itemImageS":"","itemImageM":"","itemImageL":"","itemImageXL":"","catItemTitle":"1","catItemTitleLinked":"1","catItemFeaturedNotice":"0","catItemAuthor":"1","catItemDateCreated":"1","catItemRating":"0","catItemImage":"1","catItemIntroText":"1","catItemIntroTextWordLimit":"100","catItemExtraFields":"1","catItemHits":"0","catItemCategory":"1","catItemTags":"1","catItemAttachments":"0","catItemAttachmentsCounter":"1","catItemVideo":"1","catItemVideoWidth":"","catItemVideoHeight":"","catItemAudioWidth":"","catItemAudioHeight":"","catItemVideoAutoPlay":"1","catItemImageGallery":"1","catItemImageGalleryWidth":"","catItemImageGalleryHeight":"","catItemDateModified":"0","catItemReadMore":"1","catItemCommentsAnchor":"1","catItemK2Plugins":"1","itemDateCreated":"1","itemTitle":"1","itemFeaturedNotice":"1","itemAuthor":"0","itemFontResizer":"0","itemPrintButton":"0","itemEmailButton":"0","itemSocialButton":"0","itemVideoAnchor":"1","itemImageGalleryAnchor":"1","itemCommentsAnchor":"1","itemRating":"0","itemImage":"1","itemImgSize":"Large","itemImageMainCaption":"1","itemImageMainCredits":"1","itemIntroText":"1","itemFullText":"1","itemExtraFields":"1","itemDateModified":"0","itemHits":"0","itemCategory":"1","itemTags":"1","itemAttachments":"1","itemAttachmentsCounter":"1","itemVideo":"1","itemVideoWidth":"","itemVideoHeight":"","itemAudioWidth":"","itemAudioHeight":"","itemVideoAutoPlay":"0","itemVideoCaption":"1","itemVideoCredits":"1","itemImageGallery":"1","itemImageGalleryWidth":"","itemImageGalleryHeight":"","itemNavigation":"1","itemComments":"1","itemTwitterButton":"0","itemFacebookButton":"0","itemGooglePlusOneButton":"0","itemAuthorBlock":"0","itemAuthorImage":"0","itemAuthorDescription":"0","itemAuthorURL":"0","itemAuthorEmail":"0","itemAuthorLatest":"0","itemAuthorLatestLimit":"5","itemRelated":"1","itemRelatedLimit":"5","itemRelatedTitle":"1","itemRelatedCategory":"1","itemRelatedImageSize":"0","itemRelatedIntrotext":"0","itemRelatedFulltext":"0","itemRelatedAuthor":"0","itemRelatedMedia":"0","itemRelatedImageGallery":"0","itemK2Plugins":"1"}


Sys Info:
J! 3.8.2
K2 2.8.0

Web Server Apache
PHP version 7.0.25
MySQL version 5.6.36-82.1-log
GD image library bundled (2.1.0 compatible)
Multibyte string support Enabled
Upload limit 128M
Memory limit 768M
Open remote files (allow url fopen) Yes

Directory permissions

cache Writable
media/k2 Writable
media/k2/attachments Writable
media/k2/categories Writable
media/k2/galleries Writable
media/k2/items Writable
media/k2/users Writable
media/k2/videos Writable

K2 Modules
mod_k2_comments Installed
mod_k2_content Installed
mod_k2_tools Installed
mod_k2_user Installed

K2 Plugins

Finder - K2 Installed - Enabled
Search - K2 Installed - Enabled
System - K2 Installed - Enabled
User - K2 Installed - Enabled
mod_k2_users Installed
mod_k2_quickicons (administrator) Installed
mod_k2_stats (administrator) Installed

I've gone thro the database to make sure each K2 item has a created & modified data.

Any suggestions?

Thanks,
  • Philipp Schmidt
  • Philipp Schmidt's Avatar
03 Nov 2017 12:50 - 03 Nov 2017 12:52
Replied by Philipp Schmidt on topic Call to undefined method K2HelperHTML::loadjQuery()

Call to undefined method K2HelperHTML::loadjQuery()

Category: English K2 Community

After some debugging and digging in, i found that the reason for that issue is a k2 plugin which I wrote for the client. That plugin uses that xml manifest file:
<?xml version="1.0" encoding="utf-8"?> <extension version="2.5" type="plugin" group="k2" method="upgrade"> <creationDate>March 17th, 2015</creationDate> <copyright>All rights reserved.</copyright> <description>A Plugin creating an extra field type to link to k2 items or categories</description> <files> <filename plugin="link">link.php</filename> </files> <fields group="item-content" addfieldpath="/administrator/components/com_k2/elements/"> <fieldset addfieldpath="/plugins/k2/link/elements"> <field name="lnk_item" type="item" default="" label="K2_ADD_ITEMS" description="K2_USE_THIS_TO_ADD_ITEMS_TO_THE_LIST_BELOW" /> <!-- <field name="lnk_items" type="litems" default="" label="K2_DRAG_AND_DROP_TO_REORDER_ITEMS" description="K2_DRAG_AND_DROP_TO_REORDER_ITEMS_CLICK_THE_REMOVE_ICON_TO_REMOVE_AN_ITEM_FROM_THE_LIST"/> --> <field name="lnk_only" type="radio" default="0" label="link only" description="If set to Yes, the item itself will not appear in any Category listing but its Link instead"> <option value="0">JNO</option> <option value="1">JYES</option> </field> <!-- <field name="lnk_category" type="lcategoriesmultiple" default="" label="K2_SELECT_ONE_OR_MORE_CATEGORIES" description="K2_SELECT_ONE_ORE_MORE_CATEGORIES_FOR_WHICH_YOU_WANT_TO_FILTER_AN_ITEMS_LIST_SELECT_NONE_TO_FETCH_ITEMS_FROM_ALL_CATEGORIES"/> --> </fieldset> </fields> <fields group="category" addfieldpath="/administrator/components/com_k2/elements/"> <fieldset addfieldpath="/plugins/k2/link/elements"> <field name="lnk_item" type="item" default="" label="K2_ADD_ITEMS" description="K2_USE_THIS_TO_ADD_ITEMS_TO_THE_LIST_BELOW" /> <!-- <field name="lnk_items" type="litems" default="" label="K2_DRAG_AND_DROP_TO_REORDER_ITEMS" description="K2_DRAG_AND_DROP_TO_REORDER_ITEMS_CLICK_THE_REMOVE_ICON_TO_REMOVE_AN_ITEM_FROM_THE_LIST"/> <field name="lnk_category" type="lcategoriesmultiple" default="" label="K2_SELECT_ONE_OR_MORE_CATEGORIES" description="K2_SELECT_ONE_ORE_MORE_CATEGORIES_FOR_WHICH_YOU_WANT_TO_FILTER_AN_ITEMS_LIST_SELECT_NONE_TO_FETCH_ITEMS_FROM_ALL_CATEGORIES"/> --> </fieldset> </fields> </extension>

All the comment blocks show fields which cause the error. So with those fields commented out, the error does not appear. What is wrong with that configuration?
  • Krikor Boghossian
  • Krikor Boghossian's Avatar
01 Sep 2017 20:11
Replied by Krikor Boghossian on topic Extra field values - ordering

Extra field values - ordering

Category: English K2 Community

Let us know how it went :)
  • Catherine Mollet
  • Catherine Mollet's Avatar
01 Sep 2017 17:04
Replied by Catherine Mollet on topic Extra field values - ordering

Extra field values - ordering

Category: English K2 Community

(Quite late answer)
@Krikor — Thanks for your answer, but I can't use Multiple Extra Fields Groups (MEFG) for K2 as my website is using extensively JA K2 Filter, which is not compatible with.
@Ronny Van Der Borght — Thanks. I will try your code.
Displaying 21 - 40 out of 529 results.

Powered by Kunena Forum