Keyword

Adding social buttons to K2, small question

More
10 years 4 months ago #128599 by Max
Hello,
I'm quite new with K2 and has a small question. It's more perhaps on the algorithm of K2.
There are 3 preinstalled social buttons in K2: twitter, facebook and google+.
My goal is to add fully functional additional social buttons.
For now I have done following steps:
I've added to categories.xml and item.xml needed params and fieldsets.
I've added neccessary entires to the K2 language file.
I've added neccesary php and html tags to the item.php file.
I've checked that after opening category or material settings, neccessary entries appeared in DB and I can change them.
But still the buttons don't appear.
The string, that activates the button is:
<?php if($this->item->params->get('itemVkButton',1)): ?>
it's the same as with other preinstalled buttons.
So my question is: could anyone please tell me what have I missed?
If I comment this code then the button appears.
Thank you

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

More
10 years 4 months ago #128600 by Lefteris
Hi. First of all what you have done is a bad practice. You will lose all your changes in a future update. K2 has already a parameter you can use to add a service like sharethis to items. If that doesn't fit your needs, you will have to make a plugin, not hack K2. You can take a look at a very basic K2 example plugin at github.com/joomlaworks/example-k2-plugin .

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
10 years 4 months ago #128601 by Max
thanks for answer.
I know about "losing everything if updated" yep, not a trouble.
I didn't manage to find option of adding social buttons :( In general K2 options there is a tab Social with strangely looking text-area, but what exactly to put in and how would it work I still didn't manage to find too :(
what about plugin I found it too and was going to exam it carefully.

So to sum up, could you give me a hint about this parameter which I can use to add a service like sharethis? Link to the manual would be exactly what I need.

Thank you in advance.

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

More
10 years 4 months ago #128602 by Lefteris
You can take a look at the share this website at www.sharethis.com/ . Note that there are also other services like this. Searching the web will give you similar results.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum