|
|
Thread Tools | Display Modes |
|
#221
|
||
|
Beginner grinner
|
Quote:
|
|
|
|
||
|
#222
|
||
|
Beginner grinner
|
Quote:
Again, THANK YOU for your quick expert help. John |
|
|
|
||
|
#223
|
|
|
Beginner grinner
|
I got it to work for a specific gallery but it doesn't seem to be working for an event page or the "guest upload" link (recent new feature). Am I doing something wrong or is that not possible?
|
|
|
|
|
#224
|
|
|
Scripting dude-volunteer
|
If you post a link to your site and provide the vanity URLs that aren't working, we can take a look. Can't do much without being able to look at your specific URLs.
__________________
--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 |
|
|
|
|
#225
|
||
|
Beginner grinner
|
my website is www.jasonallenimages.com
These are the three i'm testing it out with: "britjohnguest" : "http://www.smugmug.com/photos/guest/HGWBQm/BarkowGuest", "britjohnwedding" : "http://www.jasonallenimages.com/event/barkow/gL0dBjf0tec02", "britjohnguestgal" : "http://www.jasonallenimages.com/2012Weddings/Barkow/Guest-Photos/22862163_HGWBQm" one is an event page, one is a specific gallery, and one is the link that takes guests to the upload page (this is that new feature just released) The gallery page works but the others don't. Here is my top javascript: Quote:
|
|
|
|
||
|
#226
|
|
|
Beginner grinner
|
Nevermind, it apparently works now. haha. Sorry!!
|
|
|
|
|
#227
|
|
|
Beginner grinner
|
One question about vanity URLs that I don't think has been covered in this thread yet...
I now have two custom banners on my account, with the secondary banner assigned to a specific category of albums. When I assign a vanity URL to a gallery within that category, it appears to load the primary banner first and then load the secondary banner. I've tested it out, and it looks like this only happens when I use the vanity URL. Is there something I can fix in my CSS or Javascript to correct this issue? http://keddiebears.smugmug.com The CKP category is the one with the secondary banner assigned to it. I've got a test gallery in that category right now: http://keddiebears.smugmug.com/CKP/TEST/23000083_bVPbJL And I've assigned this vanity URL to that gallery: http://keddiebears.smugmug.com/samplegallery Thanks much! |
|
|
|
|
#228
|
||
|
Scripting dude-volunteer
|
Quote:
The other thing you can do is a little more involved. Add this CSS: Code:
/* hide custom header by default so it doesn't show before redirects */
#customHeaderContainer {display: none;}
Code:
/* show custom header now */
document.getElementById("customHeaderContainer").style.display = "block";
__________________
--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; May-18-2012 at 07:34 AM. |
|
|
|
||
|
#229
|
||
|
Beginner grinner
|
Quote:
I had originally used Easy Customizer a few years back to get the primary look of my site, and only just now am branching out into learning some CSS myself. So I'm probably going to end up going back and wiping the Easy Customizer settings and coding everything through the Advanced Customization, but if there's a faster intermediate solution (i.e., if you can help me figure out how I messed up your fix!), I'd appreciate the help! |
|
|
|
||
|
#230
|
||
|
Scripting dude-volunteer
|
Quote:
Keep the CSS you have, but remove this code you added: Code:
/* show custom header now that we know we are not redirecting to a new page */
document.getElementById("customHeaderContainer").style.display = "block";
Code:
function CheckRedirects() {
if (YD.hasClass(document.body, 'homepage') || YD.hasClass(document.body, 'category')) {
// get the path from the current URL,
// convert it to lowercase and remove the leading or trailing slashes
var path = window.location.pathname.replace(/^\/|\/$/g, "").toLowerCase();
var newURL = vanityTable[path]; // look it up in our table
// if we found it in the table && newURL is different than where we are
if (newURL && (newURL != window.location.href)) {
window.location.replace(newURL); // go to the new URL
} else {
// show custom header now that we know we are not redirecting to a new page
document.getElementById("customHeaderContainer").style.display = "block";
}
}
}
__________________
--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 |
|
|
|
||
|
#231
|
|
|
Beginner grinner
|
Cannot get the Vanity URLs to work
I tried to follow these instructions but the vanity URLs still don't work.
My website is www.spectoccasio.com Here is the Top JavaScript /*VANITY URL*/ var vanityTable = { "tours": "http://www.spectoccasio.com/gallery/13553927_QEgCC", "about": "http://www.spectoccasio.com/gallery/13553921_HSXzn", "contact": "http://www.spectoccasio.com/gallery/13553914_2EWkK", "clients": "http://www.spectoccasio.com/gallery/23283319_H5gKxv", "begravning": "http://www.spectoccasio.com/gallery/23281362_f6pJ6X" }; // Vanity URLs code version 1.2 function CheckRedirects() { if (YD.hasClass(document.body, 'homepage') || YD.hasClass(document.body, 'category')) { // get the path from the current URL, // convert it to lowercase and remove the leading or trailing slashes var path = window.location.pathname.replace(/^\/|\/$/g, "").toLowerCase(); var newURL = vanityTable[path]; // look it up in our table // if we found it in the table && newURL is different than where we are if (newURL && (newURL != window.location.href)) { window.location.replace(newURL); // go to the new URL } } Thank you for your help! Anneli |
|
|
|
|
#232
|
||
|
Scripting dude-volunteer
|
Quote:
Code:
function delHover() {
imgTags = document.getElementsByTagName("img");
for (i=0; i<imgTags.length; i++) {
imgTags[i].title = "";
imgTags[i].alt = "";
}
}
__________________
--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 |
|
|
|
||
|
#233
|
||
|
Beginner grinner
|
still problems with vanity URL
Thanks for the suggestion but it did not solve the problem. Any other suggestions?
Best, Anneli Quote:
|
|
|
|
||
|
#234
|
||
|
Scripting dude-volunteer
|
Quote:
Code:
// Vanity URLs code version 1.2
function CheckRedirects() {
if (YD.hasClass(document.body, 'homepage') || YD.hasClass(document.body, 'category')) {
// get the path from the current URL,
// convert it to lowercase and remove the leading or trailing slashes
var path = window.location.pathname.replace(/^\/|\/$/g, "").toLowerCase();
var newURL = vanityTable[path]; // look it up in our table
// if we found it in the table && newURL is different than where we are
if (newURL && (newURL != window.location.href)) {
window.location.replace(newURL); // go to the new URL
}
}
}
__________________
--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 |
|
|
|
||
|
#235
|
||
|
Beginner grinner
|
Thank you!
Quote:
|
|
|
|
||
|
#236
|
|
|
Major grins
|
***Edit***Found the issue!!! Thanks John for putting this together. I've followed the steps & triple checked each line but cannot figure out why the vanity URL's aren't working....
TOP JAVASCRIPT var vanityTable = { "washingtondc" : "http://travischancephotography.smugmug.com/Urban/Washington-DC/7531777_wMhr6q#!i=977186600&k=88qai", "chicago" : "http://travischancephotography.smugmug.com/Urban/Chicago/17258114_pT5btg#!i=1310216061&k=G9qTsR7", "newyork": "http://travischancephotography.smugmug.com/Urban/NYC/13394056_GNQcdw#!i=1175204442&k=WBjjq", "lasvegas": "http://travischancephotography.smugmug.com/Urban/LasVegas/12282242_qTm5GB#!i=1302571472&k=BwKMM22" } // Vanity URLs code version 1.2 function CheckRedirects() { if (YD.hasClass(document.body, 'homepage') || YD.hasClass(document.body, 'category')) { // get the path from the current URL, // convert it to lowercase and remove the leading or trailing slashes var path = window.location.pathname.replace(/^\/|\/$/g, "").toLowerCase(); var newURL = vanityTable[path]; // look it up in our table // if we found it in the table && newURL is different than where we are if (newURL && (newURL != window.location.href)) { window.location.replace(newURL); // go to the new URL } } } Step 5 CUSTOM HEADER <script type="text/javascript" language="javascript"> CheckRedirects(); </script> |
|
|
|
|
#237
|
|
|
Big grins
|
Great!
This was very clear and beneficial.
My solution: Keep "info" or "about me" pages in a "links" gallery. No vanity URL is called Links. THANKS ![]() www.alexandramanning.com/info
__________________
www.AlexandraManning.com |
|
|
|
|
#238
|
|
|
Big grins
|
A question for clarity.
A vanity URL is really only useful for posting a link to a specific section of your smugmug to another site/email/etc. Correct? I installed the code as described in this thread and got my one test gallery to work properly. However, once the vanity URL directs to the gallery, the actual URL (a jumbled mess of random letters/numbers) displays instead. So I guess my actual question is... is there a way for the vanity URL to always display once redirected to appropriate page? |
|
|
|
|
#239
|
||
|
Scripting dude-volunteer
|
Quote:
__________________
--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 |
|
|
|
||
|
#240
|
||
|
Big grins
|
Quote:
|
|
|
|
||
| Tell The World! | |
| Thread Tools | |
| Display Modes | |
|
|