K2 Community

Join the network of the powerful content component for Joomla!

[UPDATED FOR v2.1+]

If you don't know already, K2 version 2+ features a new plugin API to easily extend the forms used for items, categories and user profiles.

That means you can write a simple plugin to add additional fields and extend K2 forms beyond "extra fields".

The K2 plugin API features 6 identical to Joomla's plugin events for the frontend with the "onK2" prefix instead of "on", 2 events for frontend display in category and user pages, plus 2+6 more events for the backend, which are used to extend the backend forms for item (one for each tab of the item form plus one generic), category and user.

Since we're basically adding fields in the backend for these 3 forms, we need to define these fields somewhere. We do so inside the XML of the plugin by defining additional "groups" of parameters.

If we want to extend the item form for example, we create a new parameter group with the name "item-content" or "item-video" (where the second part targets a specific tab in the item form). In a similar fashion, we create groups for "category" and "user". We then write in these groups our new fields (you can use all available fields options provided by Joomla!, including custom content elements) and that is how we extend K2's forms.

Download the example plugin we provide and examine the code. This example plugin adds an extra field where you can input a YouTube URL and it will automatically convert it to a video in the frontend. You enter this URL inside all 3 forms in K2 (item, category, user).

In-depth tutorials will be provided as documentation progresses. In the meantime, watch the K2 presentation video where we talk about K2 plugins and what they can do: http://k2community.joomlaworks.gr/video/k2-presentation-and-more-at

Try it out and let us know your thoughts and comments.

The plugin installs via Joomla! extension installer.

K2 plugins are installed inside the "/plugins/K2/" folder in your Joomla! site.

Tags: example, k2, plugin, youtube

Attachments:

Reply to This

Replies to This Discussion

Looks really promising...
I'm gonna try it !

Does K2 version 2+ means K2 "Pro Version" ?

Thanks Fotis.

Reply to This

There will be no "PRO" version. All planned "pro" features have been integrated in this GPL (non-commercial) release.

Reply to This

You are the best in New idea..
This is not because of K2
But of The Idea you provide..

Thanks alot.

Reply to This

do you have something to add an additional user field? I just want the user to add their phone number.

Reply to This

Sorry Fotis, I had forgotten to thank you for your reply... This is great to know that you've integrated all "pro" features in the GPL version :) Thanks again.

JoomlaWorks said:
There will be no "PRO" version. All planned "pro" features have been integrated in this GPL (non-commercial) release.

Reply to This

I've downloaded, installed and enabled the plugin. It doesn't show up anywhere in the Item view of the backend. Should this be working in the latest release?

Reply to This

I can verify as well - installed plug-in, activated, checked item and no tab for Youtube example shows (nor does it list the plug-in under information like others). - note: using 1.5.14 Joomla and latest K2.

Olaf said:
I've downloaded, installed and enabled the plugin. It doesn't show up anywhere in the Item view of the backend. Should this be working in the latest release?

Reply to This

So, Where're tutorials? )

Reply to This

I cannot seem to get the plugin to work either - has anybody had any luck running the latest version?

Reply to This

Any news on this? Joomlaworks???

Reply to This

i just installed this plugin - no probs. once you install it just go to plugins and click on the the red x to enable it

Reply to This

using the v2.0 release? I am able to install the plugin and set it to published - but it is not shown anywhere within the admin of k2 such as item,categories or extra fields.

Denis Dair said:
i just installed this plugin - no probs. once you install it just go to plugins and click on the the red x to enable it

Reply to This

Reply to This

RSS

Advertisement

Latest Activity

Plz send a link if site is live
2 hours ago
See the k2 menu choices at the bottom - latest from user or categories select the category and set the number of items and it will work
2 hours ago
FidelGonzales added a discussion
I'm having some issues getting my categories to appear properly. The culprit seems to be the following code: . In default form, there is a huge gap on the top of the category page. After removing a few of these, the issue is partially fixed with cer…
2 hours ago
someone better that i may can tell you, try commenting the div class clr's our and see what happens
2 hours ago
Thanks for the reply. Unfortunately I'm not so experienced with Firebug nor CSS. I attached a new image, where one can see more information. Does this help a bit more?
2 hours ago
Whatever is done will modify the core, but will work. How about putting the category id's in a field like the xtra filelds and teach the core to parse them out. Its changing the way things work - not likely to happen unless a module like followeyes…
2 hours ago
I don't think the concept of the single-category per item content structure is a way of thinking that is advanced and, therefore, a reason to change the content construction strategy and our subsequent way of thinking. It is merely a huge limitation…
2 hours ago
2. if you are trying to remove a video from an item in the backend, click on the video tab scroll to the bottom and check delete currrent and save
2 hours ago
Please post a link if the site is live Use firebug to see what there and what needs to be changed
2 hours ago
Also, to skip the extra field you dont want edit in the override item.php and put something like {pseudocode} phpif this->extrafield->name="fieldyouwantto skip" else let the rest of the existing foreach loop run phpendif endfor something like that s…
2 hours ago
Kibekas added a discussion
There is a problem with excess of free space between 'itemListSubCategories' and 'itemList'. It seems to be derving from div class 'itemlistsubcategories' Please see the image attached. Does anyone know how to solve this problem? Via CSS?Thanks!
2 hours ago
you can get the extra fields like this if it suits your needs $custom = $this->item->extra_fields; and then addressing extra fields for the item like echo $custom[1]->value; depending on the position, 0, 1,2,3,4 etc in the array experiment with this…
2 hours ago
Kibekas, Ninja B, Dene Goodwin and 1 more joined K2 Community
3 hours ago
deton and Daito joined JoomlaWorks's group
For K2 translators
3 hours ago
I can translate to Russian
3 hours ago
I have a case right now where I would love to be able to set several categories for one article. For now, it has been solved with the use of tags, and I suspect this is how we will have to use it in the future. It might just be that we are used to…
3 hours ago
Viktoria (and Simon), Did you ever find out how to put one single extra field (not the whole bunch...) a different place than at the bottom of the article? This means we need to have a way to identify this particular field and add the code for it…
3 hours ago
Valentine added a discussion
Greetings to all . So here is what i cant understand1. i Cant login as an admin tru k2 login in frontend form just resets and i see begining of page2. I cant understand how to remove Related videos Any help will be good thanks in advance
3 hours ago
I can translate to German
5 hours ago
Sorry man, I wish I had more time to re-analize. You'll have to tweak things around. Trial and error man.
6 hours ago

© 2010   Created by JoomlaWorks.

Badges  |  Report an Issue  |  Terms of Service