Topic-icon Predefined text for Facebook Share and Twitter Tweet.

Active Subscriptions:

None
12 years 4 months ago #40242 by none
Hi,
Is there a chance to predefine a text to share a text by facebook share button and twitter tweet button? The best option if the text is translatable by Falang. Either to call a joomla article (which is translatable by Falang) or add some text field in JFbconnect admin config.

Thanks
The topic has been locked.
Support Specialist
12 years 4 months ago #40260 by alzander
Facebook doesn't allow you to pre-define the text that is shown when the user clicks the Share button. They want the text to be completely created by the user.

As for the Twitter Share button, it is possible to pre-set the text. We're planning to add that as a feature to the next major release of JFBConnect (due out in February). If you let me know how the button is being added right now (are you using the content plugin to automatically add it to your content, are you using the Social Share module or are you using the {SCTwitterShare} tag), we can likely help you implement a minor change to have default text for those share buttons.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 4 months ago #40265 by none
Hi Alex,

Thanks for the quick answer. The thing is that I did some research before and I found a lot example to add custom text to Facebook Share. Why do you think it is not possible?
Here is one: stackoverflow.com/questions/6138780/face...tton-and-custom-text
By my settings the share buttons appear automatically but I use share tag as well.
For me the best option would be to add always the frontpage title, description and thumbnail image depends on what language the visitor browse the website.
Whether the user is browsing one of my subpage if the user clicks on share I just want to send my main page title, link a description.

Thanks
The topic has been locked.
Support Specialist
12 years 4 months ago #40285 by alzander
The Share button was overhauled by Facebook in early November. You can read their announcement blog post below:
developers.facebook.com/blog/post/2013/1...e-and-share-buttons/

With the new button, even if you use the 'old' code that you linked to above (from 2011), the 'new' button will show. Our understanding is that the ability to pre-set a title and description is no longer possible with the new button. You can see more information about the new button on the page below. At the top, you can see the note that the 'old' button now loads the 'new' button. You can also see the available settings at the bottom of the page, which do not include the title or description tags:
developers.facebook.com/docs/plugins/share-button/

I hope that helps explain. We understand and agree that being able to pre-fill those values would be nice.. but, as noted above, I don't think that's possible anymore.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 4 months ago - 12 years 4 months ago #40304 by none
Thank you Alex. Im sorry I didn't know that they have changed their code meantime. Obviously you are more aware of their code.
So my question is, can you give me a hint how to add my homepage title, url and desc to my Twitter button?
As I mentioned before the website is multilingual and I use Falang therefore the title, url and desc are different in each language.

Last time we also talked about integrating Twitter registration date in Social Network Profile Import Configuration. Twitter gives this date out.
I checked the new version (5.2.1) of JFBconnect and I couldn't find this field. Can you also tell me how can I add this field please?

I also have an issue with Twitter login. Once Im returned from Twitter to register and add my email address on the registration page I type my email address and click registration. The system accepts my registration but an error message appears on the top of the page. See screenshot.

File Attachment:



Thanks
Last edit: 12 years 4 months ago by none.
The topic has been locked.
Support Specialist
12 years 4 months ago #40327 by alzander
For the Twitter Share button, to predefine some text, you'd need to edit the /libraries/sourcecoast/easytags.php file. Around line 694, you'll see:
else if ($dataCount == 'horizontal' || $dataCount == 'vertical' || $dataCount == 'none')
     $tagButtonText .= ' data-count="' . $dataCount . '"';
Add the following after that:
$tagButtonText .= ' data-text="Check this out" ';
With that, you can set the description for the Tweet button. If you want that text to be translateable, you'd need to add it like:
$tagButtonText .= ' data-text="' . JText::_('COM_JFBCONNECT_TWEET_DESCRIPTION') . '" ';
Then, in the /language/xx_YY/xx_YY.com_jfbconnect.ini files, add that string with your translation.

If you want to hard-code the URL, you can do so by updating the line to:
$tagButtonText .= ' data-url="http://yoursite.com/" data-text="Check this out" ';
However, I wouldn't recommend that. Each Tweet button should really be for the page it's on. It will be confusing to your users if they are sharing the home page even though they are on some interior page. It's up to you to set things up how you want.

As for the error messages on login, I'm not sure why all those user IDs are trying to be loaded. I'd try going to the JFBConnect -> Usermap area. Just going there may help clear some issues up as we run some checks when loading that page. Once there, also check the Twitter connections to your users and see if there are multiple connections to the same user or any incorrect connections. That could explain the incorrect loads if JFBConnect is trying to load a Joomla user that no longer exists.

I hope that helps get you going,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 4 months ago #40408 by none
You are right. Probably we wont modify the Twitter text. I tried to check these user idsin community builder and in joomla user manager but nothing came up. They are old user ids. They've been transfered from old joomla 1.5 but since then those users got the new 2.5 user ids. I wil also have a look at the database to see if I find something but its a bit odd. I dont really understand from where the Twitter login gets these old ids.

You havent answered my third question about getting the twitter registration date from twitter. Can you please have a look at it Alex?

Thanks
The topic has been locked.
Support Specialist
12 years 4 months ago #40418 by alzander
Your explanation of the wrong IDs is helpful. When JFBConnect tries to register a user, we look in the #__users table for a user with the same email address. It's possible that the email address exists in there, but there's something wrong with the rest of the information. Alternatively, if you moved JFBConnect as well from a previous installation, our #__jfbconnect_user_map table could still be referencing those obsolete user IDs in the j_user_id column.

As for the registration date, sorry for not getting back to you on that sooner. The most simple way to get that date is to edit the /components/com_jfbconnect/libraries/profile/twitter.php file. At the top, you'll see a section like:
$this->providerFields = array(
            '0' => 'None',
            'name' => 'Full Name',
            'first_name' => 'First Name',
            'last_name' => 'Last Name',
            'location' => 'Location',
            'entities.url.urls.0.expanded_url' => 'Website',
            'description' => 'Description',
            'friends_count' => 'Friend Count',
            'followers_count' => 'Followers Count',
            'listed_count' => 'Listed Count',
            'statuses_count' => 'Status Update Count',
            'screen_name' => 'Twitter Username'
        );
Simply add another line in there, like:
'screen_name' => 'Twitter Username',
            'created_at' => 'Registration Date'
Please note that I added a comma at the end of the first line that wasn't there before.

Then, in the Profiles area of JFBConnect, you'll see "Registration Date" as a drop-down option. The format of the date will come back like:
Thu Mar 12 14:42:59 +0000 2009
It is possible to add some extra formatting to that so it works in a date field on your site, but it depends on where/how you're importing it. For now. Just let me know if you need help with that.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 4 months ago #40420 by none
Thanks Alex, you are extremely helpful. You provide a top level support. Last question.. Can you add this twitter registration date to the next version of JFBconnect please?

Thanks
The topic has been locked.
Support Specialist
12 years 4 months ago #40451 by alzander
We have it as a task to add this field in the next major release, due in February. The only thing we have to decide is how we're planning to format that value. How are you using it? Are you just storing the date value I mentioned above? Curious how you're using it..

Thanks,
Alex
The topic has been locked.