-
AuthorPosts
-
roojai Friend
roojai
- Join date:
- January 2013
- Posts:
- 28
- Downloads:
- 4
- Uploads:
- 1
- Thanks:
- 3
- Thanked:
- 5 times in 1 posts
August 29, 2013 at 3:25 pm #190146I want the user that has clicked the shared article within facebook to land in the article within the structure of my website. Currently they land with ?tmpl=component at the end of the URL which means they cannot see the menu etc.
This is from the JA Wall K2 template with the pop up function.
I have added some custom social links but the native K2 links have the same effect.
Any tips to remove the ?tmpl=component from the URL from the social link buttons in articles (items) appreciated.
Website here:
http://www.tritonstriathlon.com/
Many thanks 🙂
phong nam Friendphong nam
- Join date:
- May 2015
- Posts:
- 3779
- Downloads:
- 1
- Uploads:
- 587
- Thanks:
- 499
- Thanked:
- 974 times in 888 posts
August 30, 2013 at 3:51 am #504041Hi roojai,
You can backup your files and try to follow this tip to solve your issue at http://www.joomlart.com/forums/topic/social-bookmark-url-issue-with-tmplcomponent-added-to-the-back-link/
roojai Friendroojai
- Join date:
- January 2013
- Posts:
- 28
- Downloads:
- 4
- Uploads:
- 1
- Thanks:
- 3
- Thanked:
- 5 times in 1 posts
August 30, 2013 at 10:40 am #504095Thanks for the help.
There are a few solutions mentioned in that thread, do you mean this code:<script type=”text/javascript”>
(function(d){
var js, id = ‘facebook-jssdk’, ref = d.getElementsByTagName(‘script’)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(‘script’); js.id = id; js.async = true;
js.src = “//connect.facebook.net/en_US/all.js#xfbml=1”;
ref.parentNode.insertBefore(js, ref);
}(document));
</script><!– Place this tag after the last +1 button tag. –>
<script type=”text/javascript”>
(function(d) {
var js, id = ‘gplus-jssdk’, ref = document.getElementsByTagName(‘script’)[0];
if (d.getElementById(id)) {return;}
js = document.createElement(‘script’); js.id = id; js.type = ‘text/javascript’; js.async = true;
js.src = ‘https://apis.google.com/js/plusone.js’;
ref.parentNode.insertBefore(js, ref);
})(document);
</script><?php
$fulllink = JURI::getInstance()->toString(array(‘scheme’, ‘host’, ‘port’)) . $this->item->readmore_link;
$sociallink = new JURI($fulllink);
$sociallink->delVar(‘tmpl’);
?>
<div class=”fb-like” data-href=”<?php echo $sociallink; ?>” data-send=”false” data-layout=”button_count” data-width=”150″ data-show-faces=”false”></div>
<div class=”g-plusone” data-annotation=”inline” data-width=”300″ data-href=”<?php echo $sociallink; ?>”></div><div class=”fb-comments” data-href=”<?php echo $sociallink; ?>” data-num-posts=”2″ data-width=”576″></div>
roojai Friendroojai
- Join date:
- January 2013
- Posts:
- 28
- Downloads:
- 4
- Uploads:
- 1
- Thanks:
- 3
- Thanked:
- 5 times in 1 posts
August 30, 2013 at 10:44 am #504096That doesn’t seem to work. I am now trying this – but it is unclear on how to do the FB button:
data-url=”<?php echo substr(JURI::root(),0,-1).str_replace(JURI::root(true),”,$this->item->link); ?>”
roojai Friendroojai
- Join date:
- January 2013
- Posts:
- 28
- Downloads:
- 4
- Uploads:
- 1
- Thanks:
- 3
- Thanked:
- 5 times in 1 posts
August 30, 2013 at 11:30 am #504101That did not work. Instead I did this (this is for K2 item like button only):
<!– this is standard facebook button code –>
<div class=”itemFacebookButton” style=”min-height:180px;”>
<div id=”fb-root”></div>
<script type=”text/javascript”>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = “//connect.facebook.net/en_US/all.js#xfbml=1″;
fjs.parentNode.insertBefore(js, fjs);
}(document, ‘script’, ‘facebook-jssdk’));
</script>
<!– this is the only bit that has been changed–>
<div class=”fb-like” data-send=”false” data-width=”200″ data-href=”http://www.your.ulr..com<?php echo $this->item->link ?>” data-show-faces=”true”></div>
</div>It works fine – facebook links back to the article in the item view
1 user says Thank You to roojai for this useful post
-
AuthorPosts
This topic contains 5 replies, has 2 voices, and was last updated by roojai 11 years, 2 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum