Trying to insert Social media button scripts

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Trying to insert Social media button scripts

Unread postby Mark Wilsdorf » Fri Aug 04, 2017 11:38 pm

I'm using the PP skins, by the way...

I've tried inserting script code like the following, using the Insert HTML Code option, but it doesn't show up at all in WebHelp output. I was hoping to have some flexibility for page placement, but does the script code need to be in the skin's page template?

Code: Select all
<script src="//platform.linkedin.com/in.js" type="text/javascript"> lang: en_US</script>
<script type="IN/FollowCompany" data-id="24995473"></script>
Mark Wilsdorf
 
Posts: 105
Joined: Thu Dec 24, 2009 8:41 pm

Re: Trying to insert Social media button scripts

Unread postby Mark Wilsdorf » Fri Aug 04, 2017 11:55 pm

EDIT: NEVER MIND...following is incorrect. The code DOES appear with surrounding <div> tags, but still does nothing.


OK, tried it again (was in a table cell before). Now I see the script code in the HTML source for the page (in the browser). However it shows up this way, and doesn't display any button:

Code: Select all
<p class="p_Indent0"><script src="//platform.linkedin.com/in.js" type="text/javascript"> lang: en_US</script>
<script type="IN/FollowCompany" data-id="24995473"></script></p>


...with surrounding <p> elements, even though the code in the Insert HTML code box is as follows, and HTML code must not be enclosed in a block tag is selected.

Code: Select all
<div>
<script src="//platform.linkedin.com/in.js" type="text/javascript"> lang: en_US</script>
<script type="IN/FollowCompany" data-id="24995473"></script>
</div>


In other words, regardless of what I do it seems the script code gets enclosed in <p> tags.
Mark Wilsdorf
 
Posts: 105
Joined: Thu Dec 24, 2009 8:41 pm

Re: Trying to insert Social media button scripts

Unread postby Mark Wilsdorf » Sat Aug 05, 2017 12:18 am

Ouch...never mind again, Tim!....

I just found out the problem is with Firefox...there's a StackExchange thread on the problem, here:

https://stackoverflow.com/questions/281 ... in-firefox

Works fine in Chrome. Sorry to have bothered you with this.
Mark Wilsdorf
 
Posts: 105
Joined: Thu Dec 24, 2009 8:41 pm

Re: Trying to insert Social media button scripts

Unread postby Tim Green » Sat Aug 05, 2017 8:56 am

Hi Mark,

All this is already integrated in these skins. Why don't you just activate the social sharing options? Getting the right URL for sharing a topic is not as simple as it seems.

V3 skins:
http://www.it-authoring.com/info/pp3hel ... share.html

V2 skins (share button):
http://www.it-authoring.com/info/pp3hel ... eopts.html

Note that if you add code like this to the V3 skin templates it will only work when a topic is accessed directly. It will not appear at all or work when the user browses to another topic within the help, because the topic content is loaded dynamically from a compressed version that has nothing to do with the HTML file.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
 
Posts: 19415
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany

Re: Trying to insert Social media button scripts

Unread postby Mark Wilsdorf » Sat Aug 05, 2017 12:34 pm

Thanks Tim.

Yes, I'm aware of the skins' social sharing options. But I'm maintaining a Web site with H&M, and most site visitors expect social sharing to be directly accessible via icons on the page. I don't have time or opportunity to educate a casual, one-time site visitor to social sharing options tucked away in the hamburger menu--they're neither visible enough nor visual enough (not associated with an immediately recognizable icon) for what I need,

I appreciate all the work you've gone to, to provide automated social sharing options for the hamburger menu--I really think it's a cool feature. But I wish that either (1) the individual options (Facebook, Google+, etc.) enabled in the skin via PP Toolbox were callable from HTML or script code, so they could be associated with a button or link on the page, or (2) that the entire Share this Topic popup could be invoked in the same way--via a Share button on the page.

Thanks as always for your excellent help, and very quick, responsive support of H&M.
Mark Wilsdorf
 
Posts: 105
Joined: Thu Dec 24, 2009 8:41 pm

Re: Trying to insert Social media button scripts

Unread postby Mark Wilsdorf » Wed Aug 09, 2017 12:35 pm

I was able to get the social sharing popup to display via a clickable link (instead of from the hamburger menu), using a script link that omitted the leading and trailing quotation marks of the necessary script code:

Code: Select all
javascript:hmWebHelp.closeTopNav()" data-target="socialsharing.js" data-path="./js/" data-title="Share this Page" class="popuplink" title="Share this page


If there are any likely problems with this Tim (except that a future H&M or skins release might break it, which I understand), please let me know.
Mark Wilsdorf
 
Posts: 105
Joined: Thu Dec 24, 2009 8:41 pm

Re: Trying to insert Social media button scripts

Unread postby Tim Green » Wed Aug 09, 2017 5:49 pm

Hi Mark,

That shouldn't be a problem, as long as it works both in the first topic you visit and in subsequent topics you browse to after landing on that first topic. That is the key test you need to perform for things like that.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Tim Green
Site Admin
 
Posts: 19415
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany

Re: Trying to insert Social media button scripts

Unread postby Mark Wilsdorf » Wed Aug 09, 2017 6:32 pm

Tim,

Good to know...thanks for the heads-up.
Mark Wilsdorf
 
Posts: 105
Joined: Thu Dec 24, 2009 8:41 pm


Return to Help & Manual 7 Forum

Who is online

Users browsing this forum: No registered users and 2 guests