Problems with social api

September 2015 Joomla Template
GK User
Mon Apr 18, 2016 9:27 pm
Hi, I've many problems with social api integrated function in technews template.

First:
When I share an article in Facebook it doesn't share the specific page address but only mysitename.com and then reminds back (if I click the link on facebook) to a generic "mysitename.com/index.php?option=com_content" ....so people go back to a page that is not home, neither the article I wanted to share.

Second:
If I insert specific article IDs in the field "excluded articles", or category name in the next field (excluded categories) nothing happens. The share buttons remain inside the article. This is a problem if I want to exclude, for example, privacy and terms articles and so on...

Any suggestions?
User avatar
Junior Boarder

GK User
Tue Apr 19, 2016 2:27 pm
First problem solved: it was because of the sef urls. But when I share an articles it displays article author, also if I hide it from global configuration>articles

Anyway, second problem remains.
User avatar
Junior Boarder

teitbite
Sat Apr 30, 2016 12:11 pm
Hi

Can I please see an example of such article ? I do not think I understand. Which social option You have in mind ? The one which came with template, the build one in K2 or a custom one provided by K2 as well.
User avatar
Moderator

GK User
Tue May 03, 2016 2:37 pm
It's the built-in.
In the tab "social api" under template features, fields "excluded articles", "excluded categories"...
...it doesn't work...

And the other problem is about post author (see attached)
gavick_forum.jpg
User avatar
Junior Boarder

teitbite
Wed May 04, 2016 3:25 pm
Hi

I honestly cannot tell what could it be from this screenshot, because it's a result of this function already. I think best would be to use some 3rd party plugin instead and remove this template provided code from /layout/blocks/social.php file.
User avatar
Moderator

GK User
Sat May 07, 2016 11:18 am
Yes I can do it, but I really like the opportunity to have a share tool in my articles, so if I can find a solution I'll post it. Anyway in your template functions the problem still remains: I cannot exclude articles or categories. It doesn't work.
So I suggest to fix this bug in your next template updates....
User avatar
Junior Boarder

teitbite
Mon May 09, 2016 1:38 pm
Hi

I've passed the information to programmers. Thank You for reporting that.
User avatar
Moderator

teitbite
Tue May 10, 2016 12:09 pm
Hi

Programmers has checked the exclusion and it works. Code for exclusion is in gk_technews/lib/framework/helper.social.php

Code: Select all
       // check the excluded article IDs and category IDs
       if(($option == 'com_content' && $view == 'article' && in_array($id, $excluded_articles, false)) ||
          ($catid != '' && $option == 'com_content' && $view == 'article' && in_array($catid, $excluded_categories, false)) || $embed_mode) {
          $is_excluded = true;
            // clear SocialAPI div
          GKParser::$customRules['/<gavern:social(.*?)gavern:social>/mis'] = '';
          GKParser::$customRules['/<gavern:socialAPI(.*?)gavern:socialAPI>/mis'] = '';
       } else {
            GKParser::$customRules['/<gavern:social>/mi'] = '';
            GKParser::$customRules['/<\/gavern:social>/mi'] = '';
            GKParser::$customRules['/<gavern:socialAPI>/mi'] = '';
            GKParser::$customRules['/<\/gavern:socialAPI>/mi'] = '';
        }


So problem may be that You are not using template's buttons in fact, but article buttons. If those are article buttons than You can simply disable them in category/item configuration.
User avatar
Moderator

GK User
Tue May 10, 2016 1:48 pm
I'm using social icons.
If I use widgets in articles = excluded categories function works.
If I use social icons = excluded categories function doesn't work....
So is there any way to exclude articles or categories using social icons?
User avatar
Junior Boarder

teitbite
Wed May 11, 2016 1:19 pm
Hi

Ok. I do not think if we understand each other. Is the social icons problem on the same website as the 404 error page issue You've send me an access to before?

If yes than I can see You are using component feature (as on screen), so exclusion has to be done in category or item settings.
User avatar
Moderator

GK User
Fri May 13, 2016 12:29 pm
Now I understand why I didn't find the option... I'm not using K2 articles or categories. So I can exclude them only if they are build in K2.
Thanks.
User avatar
Junior Boarder

teitbite
Sat May 14, 2016 6:51 pm
Hi

I'm not sure that You can't. There needs to be such option in category, but You can always hide it with css. Just add this to override.css file:

Code: Select all
.item-social-icons { display: none; }


If You want to hide it only in some places use page class suffix as described here: https://www.gavick.com/documentation/jo ... omla-pages
User avatar
Moderator


cron