Share this position question

perrie
@perrie
9 years ago
435 posts
Hi Everyone,

I am using the share this plugin from Jamroom. It has options for the side or the bottom, but I would like it to show at the top of a discussion. Do I need to override the Jamroom option and get the code from Share this. And if I do, which templet would I put it in ( I am assuming the discussion one), and do I disable the plugin?
Thanks,
Perrie~
updated by @perrie: 05/15/16 02:18:04PM
derrickhand300
@derrickhand300
9 years ago
1,353 posts
I did this using the share this code for the horizontal buttons..copied the code to a notepad file and uploaded it to my server as custom_share_this.tpl in skin templates

Then in the template where I want it to display I use
{jrCore_include template="custom_share_this.tpl"}

To figure out where to put the code i always go into DEVELOPER TOOLS and select the checkbox that says something like " show the template code in source" and save/exit....then go to the discussion page where you want it to show up- right click on that area and select "view page source" or whatever its worderded as in your particular browser...then you will see the green text that looks similar to this
<!--profile_discussion template-->

just find the line of green code thats directly above the spot where you clicked ( the spot where you want the Share This to be) and thats usually the template you need to add the custom share this to....just have to play with it on that page to find the right spot-I usually type stuff like
ZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX
YYYYYYYYYYYYYYYYY in different areas of the template- then view the page live and whichever area has the letters that i want the code added to- I add the custom share this there.......then erase all the caps i added..
Just my workaround...hope it makes sense or helps in some way

Then share that particular page and go to facebook debugger and enter the url then select "FETCH"...if you see an error that says something about circular redirect or something-then you will maybe need to remove the original share this code from the page so you dont have it on there twice

Here is the link to facebook debugger https://developers.facebook.com/tools/debug/
updated by @derrickhand300: 12/06/15 12:24:58AM
perrie
@perrie
9 years ago
435 posts
YIKES!

OK not what I expected. Let's just say that I am not gifted with uploading to the server.

I know that there used to be a place to leave requests. I just don't remember where.
I am not sure why having "share this" on top, isn't an option. That is a whole lot of hoops to jump through to get it on top, while having it on the bottom and the side is just a click away.
michael
@michael
9 years ago
7,714 posts
There are many ways to do things, you have an idea that would probably work but haven't yet tried it so it reads like a how do I do this question. Derrickhand300 has provided an alternative way that's also valid.

I reckon the solution closest to what you were thinking of trying is:
* yes, do disable the sharethis module.
* add their code at the top of maybe the profile_item_detail.tpl page

That would get it out on all profile details pages.

derrickhand300 idea of adding ZZZZZZZZZZZZZ is a good one, I use that too. It allows you to see where something is coming out before trying to add in more complex code so you know your in the right place.
michael
@michael
9 years ago
7,714 posts
Or another way might be to change the item_detail.tpl page of the module your interested in

It probably has something like this in that template
    {if jrGroup_member_has_access($item)}
        {* bring in the item details *}
        {jrCore_item_detail_features module="jrGroupDiscuss" item=$item}
    {/if}
at the bottom that brings in the sharethis fuctionality from the module.

leave the module enabled and add this to the top of that file:
{jrShareThis module="jrGroupDiscuss" item_id=$item._item_id}

thats for the jrGroupDiscuss module, adjust for whichever module template your altering. :)
perrie
@perrie
9 years ago
435 posts
Hi Michael,

I tried your last option, but it didn't work and I think that is because I have a custom discussion templet.
perrie
@perrie
8 years ago
435 posts
Michael,
I am trying to understand your directions. I feel embolden from fixing my facebook issue, so would like to tackle this one.
michael
@michael
8 years ago
7,714 posts
Good one. :)

If you get stuck, you need to give me more than "it didn't work" in order for me to offer any extra suggestions as to what could be the issue.
perrie
@perrie
8 years ago
435 posts
OK for starters, what do you mean by {* bring in the item details *}. What do I fill in there?
Ceri
Ceri
@adolygwr
8 years ago
370 posts
Hi Perrie...did you mean something like this?

https://americymru.net/community/forum/wales-grand-slam-scoreline-prediction-forum/2988/saturday-march-19th-wales-v-italy-230pm-scoreline-prediction

I had the same question a while back and sorted it by placing share this code in various templates until I got it just right...well almost anyway :)


--
Ceri Shaw - AmeriCymru
michael
@michael
8 years ago
7,714 posts
perrie:
OK for starters, what do you mean by {* bring in the item details *}. What do I fill in there?

That is a code comment that is explaining what that section of code is doing.

Docs: "Smarty comments"
http://www.smarty.net/docs/en/language.basic.syntax.tpl
Strumelia
Strumelia
@strumelia
8 years ago
3,603 posts
Perrie- in your written codes, if you insert some explanation or note to yourself in the code and wrap it inside {* then it will be seen as a mere note and will not be applied as part of the code. The wrap makes it inactive text. It's only a note to yourself or whoever is looking at the code, so that you know where a certain added code starts and what it's supposed to do. Such code 'comments' are handy especially as time passes and you forgot where you added some custom code or what that code was for. You can put/edit whatever description you want inside the two {* or you can delete that whole note, and it won't change anything in how the code is functioning.




--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015

updated by @strumelia: 02/06/16 09:29:08AM
perrie
@perrie
8 years ago
435 posts
Hi adolygwr

If those buttons appear there on every discussion, that would be perfect. What did you do?
perrie
@perrie
8 years ago
435 posts
Strumelia,

Thanks for the tip. It's true that you forget what you did after a while. I try to keep notes on "notepad" but sometimes still, you didn't realize that you have been a bit cryptic. So just put something like {*this is my code} and it won't mess up any other code.... did I get that right?
Ceri
Ceri
@adolygwr
8 years ago
370 posts
perrie:
Hi adolygwr

If those buttons appear there on every discussion, that would be perfect. What did you do?

I added the share this code to 3 templates for the forum feature

Profiles/Forum/Templates item_categories.tpl item_details.tpl item_index.tpl

as per the screenshot below. That shot is item detail. You may need to move the code up or down a little depending where you want it on the page.

In the second screenshot you can see the share this code (important to remember to wrap it in the {literal} {/literal} tags) and a div with border that I threw in by way of styling.


--
Ceri Shaw - AmeriCymru

updated by @adolygwr: 02/06/16 12:11:29PM
Strumelia
Strumelia
@strumelia
8 years ago
3,603 posts
perrie:
Strumelia,
just put something like {*this is my code} and it won't mess up any other code.... did I get that right?

Use the spaces between the asterisks and the descriptive comment, and remember the closing asterisk as well, so:
{* comment here *}
and have it all on its own line in the code so you can easily spot it.
Your comment can be something like:
The following code from Michael adds a button on profile pages for messaging

or:
This is where I used to have the code for showing the member's location, removed Feb2016

....or any description you like.




--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015

updated by @strumelia: 02/06/16 12:33:06PM
derrickhand300
@derrickhand300
8 years ago
1,353 posts
You can highlight the code that way OR if you want it to show up in page source ( I noticed when I looked at your sites source code that in DEVELOPER you had SHOW TEMPLATES IN SOURCE CODE selected ) so to get the code to show up in your source cvode instead of the {*add stuff here*} you would want to use the
<!--ADD STUFF HERE-->
Helps to find where you are at when trying to find the proper place to insert something
updated by @derrickhand300: 02/08/16 06:54:19AM
perrie
@perrie
8 years ago
435 posts
Hi adolygwr,

Sorry I didn't get back to this sooner.
The literal tags... You said to wrap the code in them, but I only see the end literal [/literal] tag in both of your screenshots. Where is the begin literal in your code?

Strumelia and Derrick,
Thanks for the handy trick to remember where code changes are made. I know I can compare the codes, but that makes it much easier.
Ceri
Ceri
@adolygwr
8 years ago
370 posts
perrie:
Hi adolygwr,

Sorry I didn't get back to this sooner.
The literal tags... You said to wrap the code in them, but I only see the end literal [/literal] tag in both of your screenshots. Where is the begin literal in your code?

Hi Perrie....it's there....just before script type="text/javascript"

You can see it more easily in the text doc I uploaded.


--
Ceri Shaw - AmeriCymru

updated by @adolygwr: 02/12/16 11:49:27AM
perrie
@perrie
8 years ago
435 posts
OK got it!

BTW did you turn off your "share this" from the ACP after you did these changes?
Ceri
Ceri
@adolygwr
8 years ago
370 posts
Yes I did. You need to play with it a little to get it just right. Also dont be afraid to delete lines for individual buttons if they overspill into a second row. It wont affect matters much :)


--
Ceri Shaw - AmeriCymru