|
|
Thread Tools | Display Modes |
|
#1
|
|
|
Just a Guy with a Camera
|
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.com • www.r2rcoalcity.org • www.tinleyparkfrankfortrotary.com • www.smalltowntheatrics.com Use this code:8jDMwxj6yp4f2 to save on a subscription to Smugmug Last edited by brandofamily; Dec-29-2009 at 08:05 AM. |
|
|
|
|
#2
|
|
|
Just a Guy with a Camera
|
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.com • www.r2rcoalcity.org • www.tinleyparkfrankfortrotary.com • www.smalltowntheatrics.com Use this code:8jDMwxj6yp4f2 to save on a subscription to Smugmug Last edited by brandofamily; Dec-29-2009 at 02:59 PM. |
|
|
|
|
#3
|
|
|
Just a Guy with a Camera
|
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/";
}
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.com • www.r2rcoalcity.org • www.tinleyparkfrankfortrotary.com • www.smalltowntheatrics.com Use this code:8jDMwxj6yp4f2 to save on a subscription to Smugmug Last edited by brandofamily; Dec-31-2009 at 04:19 AM. |
|
|
|
|
#4
|
|
|
Just a Guy with a Camera
|
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.com • www.r2rcoalcity.org • www.tinleyparkfrankfortrotary.com • www.smalltowntheatrics.com Use this code:8jDMwxj6yp4f2 to save on a subscription to Smugmug |
|
|
|
|
#5
|
|
|
Just a Guy with a Camera
|
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/";
}
Example: http://www.brandolinoimaging.com/keyword/bob
__________________
Anthony Brandolino; Freelance Photographer • www.brandolinoimaging.com I also attend to these fine sites: www.onbroadwaydancers.com • www.r2rcoalcity.org • www.tinleyparkfrankfortrotary.com • www.smalltowntheatrics.com Use this code:8jDMwxj6yp4f2 to save on a subscription to Smugmug |
|
|
|
|
#6
|
||
|
"tweak 'til it squeaks"
|
Quote:
to link back to your searchPage?
__________________
Al My Website my Blog Mozilla Firefox Web Developer Firebug Customization FAQ Banner/Navbar/Slideshow Tutor |
|
|
|
||
|
#7
|
||
|
Just a Guy with a Camera
|
Quote:
__________________
Anthony Brandolino; Freelance Photographer • www.brandolinoimaging.com I also attend to these fine sites: www.onbroadwaydancers.com • www.r2rcoalcity.org • www.tinleyparkfrankfortrotary.com • www.smalltowntheatrics.com Use this code:8jDMwxj6yp4f2 to save on a subscription to Smugmug |
|
|
|
||
|
#8
|
||
|
"tweak 'til it squeaks"
|
Quote:
and provide at link back to your search page.
__________________
Al My Website my Blog Mozilla Firefox Web Developer Firebug Customization FAQ Banner/Navbar/Slideshow Tutor |
|
|
|
||
|
#9
|
||
|
Just a Guy with a Camera
|
Quote:
__________________
Anthony Brandolino; Freelance Photographer • www.brandolinoimaging.com I also attend to these fine sites: www.onbroadwaydancers.com • www.r2rcoalcity.org • www.tinleyparkfrankfortrotary.com • www.smalltowntheatrics.com Use this code:8jDMwxj6yp4f2 to save on a subscription to Smugmug |
|
|
|
||
|
#10
|
|
|
Just a Guy with a Camera
|
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.com • www.r2rcoalcity.org • www.tinleyparkfrankfortrotary.com • www.smalltowntheatrics.com Use this code:8jDMwxj6yp4f2 to save on a subscription to Smugmug |
|
|
|
|
#11
|
|
|
Just a Guy with a Camera
|
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/";
}
__________________
Anthony Brandolino; Freelance Photographer • www.brandolinoimaging.com I also attend to these fine sites: www.onbroadwaydancers.com • www.r2rcoalcity.org • www.tinleyparkfrankfortrotary.com • www.smalltowntheatrics.com Use this code:8jDMwxj6yp4f2 to save on a subscription to Smugmug |
|
|
|
| Tell The World! | |
| Thread Tools | |
| Display Modes | |
|
|