• Gear
  • Shots
  • Photo Craft
  • Video
  • Wide Angle
  • Support
  • New Stuff
  • More
Support Legacy SmugMug Customization Move Share button to cart line

Need some help with your New SmugMug Site?

Dgrin Challenges

Our Challenges moderator has lined up an new set of challenges for you. The Weekly Word Challenge. Get all the details and participate in the conversation Weekly Word Challenge.

Past DSS Challenge Winners, DSS Challenge Rules, and other important DSS Challenge information is here.

Looking for a little challenge? The Dgrin Mini-Challenges are a great way to challenge yourself. Take a moment to look through past winners and find the current Mini Challenge here.

From Around the Net

Enjoy a few of our favorite articles from around the 'net. If you have something you think we should see, post it here and we'll have a look.

Journeys

Landscapes

Sports

 
Thread Tools Display Modes
Page 1  of  2
1 2
Old Sep-08-2009, 07:28 AM
#1
jfriend is offline jfriend OP
Scripting dude-volunteer
Move Share button to cart line
If you have hidden the breadcrumb, but still want the Share button visible, then you can move it to the same row as the cart buttons with this customization.



To use this customization, simply paste the code below into your bottom javascript.


Code:
//------------------------------------------------------------------------------------
// Move share button to the cart line
// See http://www.dgrin.com/showthread.php?p=1206681 for support and more info.
// Version 1.0
//-------------------------------------------------------------------------------------

YE.onContentReady("shareButton", MoveToCartDiv);

function MoveToCartDiv()
{
    MoveObjToDiv(this, "cartButtonsWrapper");
}

function MoveObjToDiv(sourceObj, destDiv)
{
    var destDivObj = document.getElementById(destDiv);    // get the object for the dest div
    if (sourceObj && destDivObj)
    {
        sourceObj.parentNode.removeChild(sourceObj);    // remove object from it's current parent
        destDivObj.appendChild(sourceObj);                // add it to the new parent
    }    
}
__________________
--John
Homepage Popular
JFriend's javascript customizations Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question

Last edited by jfriend; Oct-15-2010 at 01:22 PM.
Old Oct-01-2009, 06:55 AM
#2
dejavu is offline dejavu
dejavu
dejavu's Avatar
Hi,

This afternoon, I was just looking to get this option on my site :)

Thx for sharing this script !
Old Nov-16-2009, 01:12 PM
#3
kny is offline kny
Big grins
No longer working on Keywords page?
I added this to my javascript months ago and all has worked great until relatively recently.

Now, however, I no longer have the Share button on the Keywords page.

Any insights into something that has changed?
Old Nov-16-2009, 01:16 PM
#4
jfriend is offline jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by kny
I added this to my javascript months ago and all has worked great until relatively recently.

Now, however, I no longer have the Share button on the Keywords page.

Any insights into something that has changed?
I'm wondering if there has ever been a Share button on the Keywords page because the Share button permission is a gallery option, but keywords pages can contain images from many galleries so it would be hard for Smugmug to know whether to show a share button or not.
__________________
--John
Homepage Popular
JFriend's javascript customizations Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old Nov-16-2009, 01:58 PM
#5
kny is offline kny
Big grins
Quote:
Originally Posted by jfriend
I'm wondering if there has ever been a Share button on the Keywords page because the Share button permission is a gallery option, but keywords pages can contain images from many galleries so it would be hard for Smugmug to know whether to show a share button or not.
Yes, the Share button was there until recently.

Here is example:
http://tri-to-win-events.smugmug.com.../y9-rsm-sm-pmb

Here is site that users use to get to smugmug dynamically generated keyword page smugmug site.
http://www.savagemantri.org/media_library.html
Old Nov-16-2009, 02:11 PM
#6
jfriend is offline jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by kny
Yes, the Share button was there until recently.

Here is example:
http://tri-to-win-events.smugmug.com.../y9-rsm-sm-pmb
Perhaps Smugmug changed something recently. The code to move the share button somewhere can't work because there is no share button to move.
__________________
--John
Homepage Popular
JFriend's javascript customizations Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old Nov-16-2009, 04:47 PM
#7
kny is offline kny
Big grins
Quote:
Originally Posted by jfriend
Perhaps Smugmug changed something recently. The code to move the share button somewhere can't work because there is no share button to move.
hmmm, very interesting. Would it be possible then to add a Share button directly to the CartButtonsWrapper when on the keywords page and move the existing Share button there when on Gallery page?
Old Nov-16-2009, 05:47 PM
#8
jfriend is offline jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by kny
hmmm, very interesting. Would it be possible then to add a Share button directly to the CartButtonsWrapper when on the keywords page and move the existing Share button there when on Gallery page?
It looks like some custom javascript could do possibly that, but I wouldn't know for sure until trying to make it work.
__________________
--John
Homepage Popular
JFriend's javascript customizations Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old Jun-12-2010, 09:10 PM
#9
CWSkopec is offline CWSkopec
SmugMug QA
CWSkopec's Avatar
So, I tried copying and pasting a couple times to make sure I got it right, but now I'm guessing that this code doesn't work with the Thumbnails gallery style. Sample gallery:

http://photos.chrisskopec.com/Landsc...89757898_mQuDr

Any chance this can be made to work in Thumbnails style?
__________________
Chris
SmugMug QA
My Photos
Old Jun-12-2010, 09:32 PM
#10
jfriend is offline jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by CWSkopec View Post
So, I tried copying and pasting a couple times to make sure I got it right, but now I'm guessing that this code doesn't work with the Thumbnails gallery style. Sample gallery:

http://photos.chrisskopec.com/Landsc...89757898_mQuDr

Any chance this can be made to work in Thumbnails style?
The code works fine. You just need to format it properly for the thumbnails view. Add this CSS:

#allthumbs_stretch #cartButtonsWrapper {width: 275px; text-align: right;}
__________________
--John
Homepage Popular
JFriend's javascript customizations Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old Jun-12-2010, 10:02 PM
#11
CWSkopec is offline CWSkopec
SmugMug QA
CWSkopec's Avatar
Quote:
Originally Posted by jfriend View Post
The code works fine. You just need to format it properly for the thumbnails view. Add this CSS:

#allthumbs_stretch #cartButtonsWrapper {width: 275px; text-align: right;}
Perfect, thank you, John!
__________________
Chris
SmugMug QA
My Photos
Old Aug-11-2010, 12:20 PM
#12
hrex is offline hrex
Big grins
I just don't see my share button at all... I have still ticked yes to the "Easy share" link. If I turn the appearance from Custom to SmugMug the button appears. Does this have something to do with my breadcrumb trail removed?

Thanks for the help!
www.hvitabirnir.is

Last edited by hrex; Aug-11-2010 at 12:54 PM.
Old Aug-11-2010, 01:45 PM
#13
jfriend is offline jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by hrex View Post
I just don't see my share button at all... I have still ticked yes to the "Easy share" link. If I turn the appearance from Custom to SmugMug the button appears. Does this have something to do with my breadcrumb trail removed?

Thanks for the help!
www.hvitabirnir.is
This line of your CSS is specifically hiding the Share button. Remove it if you want to see the share button.

.notLoggedIn .share_button {display:none;}
__________________
--John
Homepage Popular
JFriend's javascript customizations Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old Aug-11-2010, 02:01 PM
#14
hrex is offline hrex
Big grins
...I have revealed my ignorance in programming.

Cheers jfriend.
Old Nov-12-2011, 01:14 PM
#15
Art Minds is offline Art Minds
Surf & Sport Photography
Doesn't work with breadcrumb visible?
Please take a look at how it appears on my site: http://artminds.co/uYMIEQ

Doesn't move the Share button to the same line as the Cart buttons. Any suggestions?

Art Minds



Quote:
Originally Posted by jfriend View Post
If you have hidden the breadcrumb, but still want the Share button visible, then you can move it to the same row as the cart buttons with this customization.



To use this customization, simply paste the code below into your bottom javascript.


Code:
//------------------------------------------------------------------------------------
// Move share button to the cart line
// See http://www.dgrin.com/showthread.php?p=1206681 for support and more info.
// Version 1.0
//-------------------------------------------------------------------------------------

YE.onContentReady("shareButton", MoveToCartDiv);

function MoveToCartDiv()
{
    MoveObjToDiv(this, "cartButtonsWrapper");
}

function MoveObjToDiv(sourceObj, destDiv)
{
    var destDivObj = document.getElementById(destDiv);    // get the object for the dest div
    if (sourceObj && destDivObj)
    {
        sourceObj.parentNode.removeChild(sourceObj);    // remove object from it's current parent
        destDivObj.appendChild(sourceObj);                // add it to the new parent
    }    
}
Old Nov-12-2011, 09:24 PM
#16
jfriend is offline jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by Art Minds View Post
Please take a look at how it appears on my site: http://artminds.co/uYMIEQ

Doesn't move the Share button to the same line as the Cart buttons. Any suggestions?

Art Minds
You have a script error that stops all scripts from working. Add the missing slash (shown in red):

Code:
//------------------------------------------------------------------------------------
// Move share button to the cart line
// See http://www.dgrin.com/showthread.php?p=1206681 for support and more info.
// Version 1.0
//-------------------------------------------------------------------------------------
__________________
--John
Homepage Popular
JFriend's javascript customizations Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old Nov-12-2011, 09:40 PM
#17
Art Minds is offline Art Minds
Surf & Sport Photography
Thank you! That fixed it!
Quote:
Originally Posted by Art Minds View Post
Please take a look at how it appears on my site: http://artminds.co/uYMIEQ

Doesn't move the Share button to the same line as the Cart buttons. Any suggestions?

Art Minds
Thank you for spotting that error that must have occurred when I copied the code.

Art
Old Apr-15-2012, 06:06 PM
#18
jchin is offline jchin
J.Chin Photography
jchin's Avatar
Thanks this code works (most of the time).
Why does it sometimes move the "Share" button to the left of the "Buy" button?
Sometimes refreshing the page would move it back to the right side of "View Cart".
__________________
Johnny J. Chin ~ J. Chin Photography
FacebookFlickrSmugMug
SmugMug referral coupon code: ix3uDyfBU6xXs
(use this for a discount off your SmugMug subscription)
Old Apr-15-2012, 08:11 PM
#19
jfriend is offline jfriend OP
Scripting dude-volunteer
Quote:
Originally Posted by jchin View Post
Thanks this code works (most of the time).
Why does it sometimes move the "Share" button to the left of the "Buy" button?
Sometimes refreshing the page would move it back to the right side of "View Cart".
A variation in timing of Smugmug javascript based on how the page is loaded. See my other answer to a related question you asked for more info.
__________________
--John
Homepage Popular
JFriend's javascript customizations Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Old May-29-2012, 10:29 AM
#20
mtimber is offline mtimber
Major grins
Hi all :-)

I am using the filmstrip gallery.

When I go through to the view the image, the social media share buttons are missing.

I have set my gallery to easy share and external links, but no joy.

I suspect this mod has affected that function.

Here is an affected gallery:

http://www.rtimberlake.com/Prints/Na...3222884_m5Nq6W

Any thoughts?
Page 1  of  2
1 2
Tell The World!  

Thread Tools
Display Modes

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump