Linkedin connections button

General questions about CMSimple

Linkedin connections button

Postby roze » Sun Jul 08, 2012 8:49 pm

I want to make a Linkedin connections button. How do I do that?
Rob Zeijen,

Valkenswaard (NL)
roze
 
Posts: 100
Joined: Tue Jun 03, 2008 7:13 am
Location: NL

Re: Linkedin connections button

Postby cmb » Sun Jul 08, 2012 9:18 pm

Hi Rob,

I'm not sure, which LinkedIn button you mean. An overview is available on http://developer.linkedin.com/plugins and it has wizards to generate the required HTML code, which can be inserted to the template (or on a CMSimple page).

Christoph
Christoph M. Becker---Plugins for CMSimple_XH
cmb
 
Posts: 5481
Joined: Tue Jun 21, 2011 11:04 am
Location: Germany

Re: Linkedin connections button

Postby roze » Wed Jul 11, 2012 5:05 pm

I get this code:

Code: Select all
<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>

<script type=IN/FollowCompany data-counter="none" data-id="2653730"></script>


But when I place it on a cmsimple page nothing is visible.
Rob Zeijen,

Valkenswaard (NL)
roze
 
Posts: 100
Joined: Tue Jun 03, 2008 7:13 am
Location: NL

Re: Linkedin connections button

Postby cmb » Wed Jul 11, 2012 11:17 pm

Hi Rob,

I've just checked that: if I put the code to the template, I get the "Follow Company" button. But if I insert it on a page with tinyMCE in source code mode, nothing happens. If I check the source code after saving, I see:
Code: Select all
<script type="text/javascript" src="//platform.linkedin.com/in.js"></script>
<script type="text/javascript" data-counter="none" data-id="2653730"></script>

So it seems, tinyMCE doesn't accept type="IN/FollowCompany", but instead replaces it with type="text/javascript". If I enter the code directly to content.htm everything works as it should -- as long as this page is not saved from tinyMCE. :(

It is possible to change the default behavior of tinyMCE in this regard, but it might be simpler to use a PHP function:
Code: Select all
function linkedin_follow_company()
{
    return <<<SCRIPT
<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>

<script type="IN/FollowCompany" data-counter="none" data-id="2653730"></script>
SCRIPT;
}
 

This function has to be inserted to cmsimple/userfuncs.php. If this file doesn't exist just create it and insert:
Code: Select all
<?php

// insert the function here

?>

Then you can insert the button on a page by inserting:
Code: Select all
{{{PLUGIN:linkedin_follow_company();}}}


Perhaps it might be a good idea to develop a LinkedIn plugin, which offers this and other functionality? Any (preferably already "linked in") volunteers?

Christoph
Christoph M. Becker---Plugins for CMSimple_XH
cmb
 
Posts: 5481
Joined: Tue Jun 21, 2011 11:04 am
Location: Germany

Re: Linkedin connections button

Postby Hugh Jampton » Thu Jul 12, 2012 5:39 pm

I have also had a lot of trouble getting linked in onto my sites.
Are there various sorts of buttons?
Hugh
Hugh Jampton
 
Posts: 1
Joined: Thu Jul 12, 2012 5:31 pm
Location: Spain

Re: Linkedin connections button

Postby roze » Fri Jul 13, 2012 6:53 am

Rob Zeijen,

Valkenswaard (NL)
roze
 
Posts: 100
Joined: Tue Jun 03, 2008 7:13 am
Location: NL

Re: Linkedin connections button

Postby roze » Fri Jul 13, 2012 8:23 pm

With your help I made this:

Code: Select all
<?php

function linkedin_follow_company()
{
    return <<<SCRIPT
<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>

<script type="IN/FollowCompany" data-counter="none" data-id="2653730"></script>
SCRIPT;
}
?>
<?php
function linkedin_share_website()
{
return <<<SCRIPT
<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>

<script type=IN/Share data-url="http:/www.praktijkdommelen.nl"></script>
SCRIPT;
}
?>


in the cmsimple/userfuncs.php file


It works fine!
Rob Zeijen,

Valkenswaard (NL)
roze
 
Posts: 100
Joined: Tue Jun 03, 2008 7:13 am
Location: NL


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest