• Gear
  • Shots
  • Photo Craft
  • Video
  • Wide Angle
  • Support
  • New Stuff
  • More
Support SmugMug Customization Need help adding a button

FAQtoid

Ever wanted to create an Avatar? Creating an Avatar!

Searching Dgrin with Google Searching with Google

Dgrin Challenges

Congratulations to the Winner of DSS #128 (Sunrise or Sunset), ShootingStar.

The next Dgrin Challenge DSS #129 (Silhouette Revisited ) is open for entries through May 27th, 2013 at 8:00pm PDT.

As always, we look forward to your participation but please do take a moment to read through the rules before posting your entry.

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

Need some help with Accessories?

Tutorials

Ever find yourself wondering just how someone managed to create an image using different effects?

Here are three simple tutorials we hope will encourage you to try something new.

The Hot Seat

A lifelong interest in landscape photography has led Eyal Oren to make a study of his adopted hometown of Marblehead, MA. As you can see, his dedication is paying off!

Africa!

Dgrinners Harryb, Pathfinder, and others joined Andy Williams and Marc Muench on Safari in East Africa recently. Here are some awesome threads to check out!

 
Thread Tools Display Modes
Old Dec-29-2009, 03:53 AM
#1
brandofamily is offline brandofamily OP
Just a Guy with a Camera
brandofamily's Avatar
Need help adding a button
My old crude attempt at a button needs replacing to match the new version buttons...

I got this far, but the onClick does not send me the the Search Page. Here's the gallery example...
http://brandolinoimaging.smugmug.com...63977366_eepxV

and the code:
Code:
/*==============================================================*/
/*== Adds "Return to Search Page" Button to Appropriate Pages ==*/
/*==============================================================*/

if (YD.hasClass(document.body,"datePage"))
 {
           SM.buttons.ReturnButton = new YAHOO.widget.Button({
		id: 'Return',
		label: 'Return to Search Page',
		container: 'cartButtonsWrapper',
		type: 'button',
		onClick: "location.href='http://www.brandolinoimaging.com/searchPage/'",
		className: 'sm-button sm-button-small themesButton glyphButton'
	});
    }

else if (YD.hasClass(document.body,"keywordPage"))
 {
           SM.buttons.ReturnButton = new YAHOO.widget.Button({
		id: 'Return',
		label: 'Return to Search Page',
		container: 'cartButtonsWrapper',
		type: 'button',
		onClick: "location.href='http://www.brandolinoimaging.com/searchPage/'",
		className: 'sm-button sm-button-small themesButton glyphButton'
	});
    }

else if (YD.hasClass(document.body,"popularGallery"))
 {
           SM.buttons.ReturnButton = new YAHOO.widget.Button({
		id: 'Return',
		label: 'Return to Search Page',
		container: 'cartButtonsWrapper',
		type: 'button',
		onClick: "location.href='http://www.brandolinoimaging.com/searchPage/'",
		className: 'sm-button sm-button-small themesButton glyphButton'
	});
    }
__________________
Anthony Brandolino; Freelance Photographer • www.brandolinoimaging.com
I also attend to these fine sites:
www.onbroadwaydancers.comwww.r2rcoalcity.orgwww.tinleyparkfrankfortrotary.comwww.smalltowntheatrics.com
Use this code:8jDMwxj6yp4f2 to save on a subscription to Smugmug

Last edited by brandofamily; Dec-29-2009 at 08:05 AM.
Old Dec-29-2009, 02:26 PM
#2
brandofamily is offline brandofamily OP
Just a Guy with a Camera
brandofamily's Avatar
Got It!!!
here's the code... I'm sure it can be condensed, but I do not know how...

Code:
/*==============================================================*/
/*== Adds "Return to Search Page" Button to Appropriate Pages ==*/
/*==============================================================*/

if (YD.hasClass(document.body,"datePage"))
 {
           SM.buttons.ReturnButton = new YAHOO.widget.Button({
		id: 'Return',
		label: 'Return to Search Page',
		container: 'cartButtonsWrapper',
		type: 'button',
		onclick: { fn: RSP },
		className: 'sm-button sm-button-small themesButton glyphButton'
	});
    }

else if (YD.hasClass(document.body,"keywordPage"))
 {
           SM.buttons.ReturnButton = new YAHOO.widget.Button({
		id: 'Return',
		label: 'Return to Search Page',
		container: 'cartButtonsWrapper',
		type: 'button',
		onclick: { fn: RSP },
		className: 'sm-button sm-button-small themesButton glyphButton'
	});
    }

else if (YD.hasClass(document.body,"popularGallery"))
 {
           SM.buttons.ReturnButton = new YAHOO.widget.Button({
		id: 'Return',
		label: 'Return to Search Page',
		container: 'cartButtonsWrapper',
		type: 'button',
		onclick: { fn: RSP },
		className: 'sm-button sm-button-small themesButton glyphButton'
	});
    }

function RSP()
{
window.location = "http://www.brandolinoimaging.com/searchPage/";    
}
__________________
Anthony Brandolino; Freelance Photographer • www.brandolinoimaging.com
I also attend to these fine sites:
www.onbroadwaydancers.comwww.r2rcoalcity.orgwww.tinleyparkfrankfortrotary.comwww.smalltowntheatrics.com
Use this code:8jDMwxj6yp4f2 to save on a subscription to Smugmug

Last edited by brandofamily; Dec-29-2009 at 02:59 PM.
Old Dec-29-2009, 03:39 PM
#3
brandofamily is offline brandofamily OP
Just a Guy with a Camera
brandofamily's Avatar
Condensed version:
Code:
/*==============================================================*/
/*== Adds "Return to Search Page" Button to Appropriate Pages ==*/
/*==============================================================*/

if (YD.hasClass(document.body,"datePage") || (document.body,"keywordPage") || (document.body,"popularGallery"))
 {
           SM.buttons.ReturnButton = new YAHOO.widget.Button({
        id: 'Return',
        label: 'Return to Search Page',
        container: 'cartButtonsWrapper',
        type: 'button',
        onclick: { fn: RSP },
        className: 'sm-button sm-button-small themesButton glyphButton'
    });
    }

function RSP()
{
window.location = "http://www.brandolinoimaging.com/searchPage/";    
}
SAMPLE PAGE: http://brandolinoimaging.smugmug.com...63977366_eepxV

I guess this could be used to add a button for any type of link now...
__________________
Anthony Brandolino; Freelance Photographer • www.brandolinoimaging.com
I also attend to these fine sites:
www.onbroadwaydancers.comwww.r2rcoalcity.orgwww.tinleyparkfrankfortrotary.comwww.smalltowntheatrics.com
Use this code:8jDMwxj6yp4f2 to save on a subscription to Smugmug

Last edited by brandofamily; Dec-31-2009 at 04:19 AM.
Old Jan-04-2010, 06:41 AM
#4
brandofamily is offline brandofamily OP
Just a Guy with a Camera
brandofamily's Avatar
I need help. My long version of the code works fine, but the condensed version puts the button on all pages that have photos available to buy... HELP!!!

I also want this button to show up on the Key word search pages that return no results.
Example: http://www.brandolinoimaging.com/keyword/bob
__________________
Anthony Brandolino; Freelance Photographer • www.brandolinoimaging.com
I also attend to these fine sites:
www.onbroadwaydancers.comwww.r2rcoalcity.orgwww.tinleyparkfrankfortrotary.comwww.smalltowntheatrics.com
Use this code:8jDMwxj6yp4f2 to save on a subscription to Smugmug
Old Jan-04-2010, 06:55 AM
#5
brandofamily is offline brandofamily OP
Just a Guy with a Camera
brandofamily's Avatar
Fixed Condensed version...

Code:
/*==============================================================*/
/*== Adds "Return to Search Page" Button to "No Photos" Pages ==*/
/*==============================================================*/

if (YD.hasClass(document.body,"datePage") || YD.hasClass(document.body,"keywordPage") || YD.hasClass(document.body,"popularGallery"))
 {
           SM.buttons.ReturnButton = new YAHOO.widget.Button({
        id: 'Return',
        label: 'Return to Search Page',
        container: 'cartButtonsWrapper',
        type: 'button',
        onclick: { fn: RSP },
        className: 'sm-button sm-button-small themesButton glyphButton'
    });
    }

function RSP()
{
window.location = "http://www.brandolinoimaging.com/searchPage/";    
}
But still need to get this button to show up on the Key word search pages that return no results.
Example: http://www.brandolinoimaging.com/keyword/bob
__________________
Anthony Brandolino; Freelance Photographer • www.brandolinoimaging.com
I also attend to these fine sites:
www.onbroadwaydancers.comwww.r2rcoalcity.orgwww.tinleyparkfrankfortrotary.comwww.smalltowntheatrics.com
Use this code:8jDMwxj6yp4f2 to save on a subscription to Smugmug
Old Jan-04-2010, 07:06 AM
#6
Allen is offline Allen
"tweak 'til it squeaks"
Allen's Avatar
Quote:
Originally Posted by brandofamily
But still need to get this button to show up on the Key word search pages that return no results.
Example: http://www.brandolinoimaging.com/keyword/bob
Why not just add a div above your footer only shown on the keywordPage
to link back to your searchPage?
Old Jan-04-2010, 07:25 AM
#7
brandofamily is offline brandofamily OP
Just a Guy with a Camera
brandofamily's Avatar
Quote:
Originally Posted by Allen
Why not just add a div above your footer only shown on the keywordPage
to link back to your searchPage?
I can do that, but I only want it in the footer if the search returns no images. I'm not sure how to write the JS to test for that.
__________________
Anthony Brandolino; Freelance Photographer • www.brandolinoimaging.com
I also attend to these fine sites:
www.onbroadwaydancers.comwww.r2rcoalcity.orgwww.tinleyparkfrankfortrotary.comwww.smalltowntheatrics.com
Use this code:8jDMwxj6yp4f2 to save on a subscription to Smugmug
Old Jan-04-2010, 07:29 AM
#8
Allen is offline Allen
"tweak 'til it squeaks"
Allen's Avatar
Quote:
Originally Posted by brandofamily
I can do that, but I only want it in the footer if the search returns no images. I'm not sure how to write the JS to test for that.
What difference would it make? It would be at the very bottom (KW exists)
and provide at link back to your search page.
Old Jan-04-2010, 07:34 AM
#9
brandofamily is offline brandofamily OP
Just a Guy with a Camera
brandofamily's Avatar
Quote:
Originally Posted by Allen
What difference would it make? It would be at the very bottom (KW exists)
and provide at link back to your search page.
If the KW exists the link shows up next to cart buttons. I just don't want it in both places.
__________________
Anthony Brandolino; Freelance Photographer • www.brandolinoimaging.com
I also attend to these fine sites:
www.onbroadwaydancers.comwww.r2rcoalcity.orgwww.tinleyparkfrankfortrotary.comwww.smalltowntheatrics.com
Use this code:8jDMwxj6yp4f2 to save on a subscription to Smugmug
Old Jan-04-2010, 07:36 AM
#10
brandofamily is offline brandofamily OP
Just a Guy with a Camera
brandofamily's Avatar
I need to know how to check if there is a cart buttons or something to determine if the button is added at the bottom.
__________________
Anthony Brandolino; Freelance Photographer • www.brandolinoimaging.com
I also attend to these fine sites:
www.onbroadwaydancers.comwww.r2rcoalcity.orgwww.tinleyparkfrankfortrotary.comwww.smalltowntheatrics.com
Use this code:8jDMwxj6yp4f2 to save on a subscription to Smugmug
Old Jan-04-2010, 07:43 AM
#11
brandofamily is offline brandofamily OP
Just a Guy with a Camera
brandofamily's Avatar
I think I got it...

Code:
/*==============================================================*/
/*== Adds "Return to Search Page" Button to "No Photos" Pages ==*/
/*==============================================================*/

if (YD.hasClass(document.body,"keywordPage") && !document.getElementById("cartButtonsWrapper"))
 {
           SM.buttons.ReturnButton = new YAHOO.widget.Button({
        id: 'Return',
        label: 'Return to Search Page',
        container: 'RSPinFooter',
        type: 'button',
        onclick: { fn: RSP },
        className: 'sm-button sm-button-small themesButton glyphButton'
    });
    }

function RSP()
{
window.location = "http://www.brandolinoimaging.com/searchPage/";    
}
I think this will add it only to Keyword result pages only if there are no cart buttons present.
__________________
Anthony Brandolino; Freelance Photographer • www.brandolinoimaging.com
I also attend to these fine sites:
www.onbroadwaydancers.comwww.r2rcoalcity.orgwww.tinleyparkfrankfortrotary.comwww.smalltowntheatrics.com
Use this code:8jDMwxj6yp4f2 to save on a subscription to Smugmug
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