- Posts: 5
COMMUNITY FORUM
Adding social buttons to K2, small question
- Max
-
Topic Author
- Offline
- New Member
Less
More
11 years 1 day ago #128599
by Max
Adding social buttons to K2, small question was created 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: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
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)): ?>
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.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
11 years 1 day ago #128600
by Lefteris
Replied by Lefteris on topic Re: Adding social buttons to K2, small question
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 .
Please Log in or Create an account to join the conversation.
- Max
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 5
11 years 1 day ago #128601
by Max
Replied by Max on topic Re: Adding social buttons to K2, small question
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.
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.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
11 years 1 day ago #128602
by Lefteris
Replied by Lefteris on topic Re: Adding social buttons to K2, small question
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.
Please Log in or Create an account to join the conversation.