Skip to main content

Bookmarklets for Yahoo Store

I was introduced to "bookmarklets" by my friend, Rob Snell, many years ago at one of the Yahoo Store conferences and they are indispensable tools in my daily work on Yahoo stores.

What are "bookmarklets"?

As the name suggests, bookmarklets are kind of like bookmarks in your browser, except instead of leading to a web page, they execute a small piece of JavaScript code on the current page. This is made possible by the browser's support of the "javascript:" prefix. When you point your browser to a URL, the browser figures out what to do with it: bring up a web page if the address starts with http:// or https://, connect to an ftp site if the address starts with ftp://, or in the case of javascript:, interpret and execute the JavaScript code following the colon.

Typically, bookmarklets are saved either in your Favorites folder or if you use them on a daily basis like I do, in your browser's bookmarks toolbar. In essence, bookmarklets are sort of like browser extensions or browser add-ons, except they don't bloat your browser and take up memory. While extensions load with your browser when the browser starts, bookmarklets only run when you need them and disappear from memory when they are done.

How to create a bookmarklet

Normally, you create bookmarks by clicking the "Add to Favorites" or similar options in your bookmarks menu. This adds the current page to your favorites. However, you can also create a bookmark "manually", by right-clicking your bookmarks toolbar and selecting "Add page..." in Chrome, or "New Bookmark" in Firefox (Microsoft Edge is a bit quirkier in this department, more on that later.)


When you create a new bookmark, the browser will ask you for the name and a location. For name, you just enter whatever you want to call the bookmark. Just as an example, let's enter "Hello". The location field is where the magic happens: there you enter the word javascript: followed by the small piece of javascript code you want the bookmark to execute. Just as a test, enter the following:


javascript:alert("Hello there!")


(After the bookmark is created, you may have to actually drag it to the actual bookmarks toolbar.) Once done, you will see your new bookmarklet on your bookmarks toolbar. If you click it, the browser will bring up a prompt like this:


Ok, not too useful, but you get the idea! Now on to the real useful bookmarks I was talking about. I want to show you five bookmarklets that will make your life editing your Yahoo store easier - guaranteed!

Please note: the following bookmarklets all require you to be logged into your Yahoo store account. If you are not logged in, all these bookmarklets will simply take you to the Yahoo store login page.

Also, one disclaimer: these bookmarklets work by looking at the HTML code of the current page and trying to identify links to the cart page to figure out the store's Yahoo account ID. This works in the vast majority of cases, however, no two custom stores are the same, and yours might have a different way of linking to the shopping cart page. Unfortunately, in such cases, these bookmarklets will not work on your store. At least three out of the five won't. Edit this page and Go to this ID will still work.

1. Go to the Store Manager

When you are viewing any page of your store, clicking this bookmarklet will take you into the Store manager. I call it Y! Mgr just so it doesn't take up much space on the bookmarks bar. Here is the code:

javascript:var%20re%20=%20new%20RegExp('/cgi-bin/wg-order[?]([a-z0-9-]+)');var%20m%20=%20document.body.innerHTML.match(re);%20if%20(m)%20{document.location.href='http://edit.store.yahoo.com/RT/MGR.'%20+%20m[1];}

2. Go to this page in the Editor

This bookmarklet will take you to the same page you are looking at but in the store editor. So you can be browsing your live site, and if you quickly want to go to the editor for the page you are on, simply click this bookmarklet.

Note: for this bookmarklet to work, you have to have been in the editor at least once during your browsing session. Otherwise clicking this bookmarklet will take you into the Store Manager only. Here is the code:

javascript:var%20n%20=%20new%20RegExp(%22/([a-z0-9-]+.html)%22);%20var%20pg%20=%20location.href.match(n);%20if%20(pg)%20{%20target%20=%20'/'+pg[1]%20}else{target=''};%20var%20re%20=%20new%20RegExp('/cgi-bin/wg-order[?]([a-z0-9-]+)');var%20m%20=%20document.body.innerHTML.match(re);%20if%20(m)%20{document.location.href='http://'+m[1]+'.edit.store.yahoosmallbusiness.net/RT/NEWEDIT.'%20+%20m[1]%20+%20target;}

3. Go to this ID

When you are in the store editor, you may want to quickly jump to a page whose ID you know. There are of course a number of ways to do that, for example clicking "Controls" and then Search or Edit by ID, or using the "Find" button. However, with this bookmarklet all you have to do is click while you are on any page of your store. It will prompt you for the ID, and once you enter it, you will be taken to that page.

javascript:(function()%7Bvar%20target%20%3D%20prompt(%22Target%20ID%3A%22)%3Bif%20(target%20!%3D%20null)%20%7Blocation.href%20%3D%20document.URL.substr(0%2Cdocument.URL.lastIndexOf('%2F'))%20%2B%20%22%2F%22%20%2B%20target%20%2B%20%22.html%22%3B%7D%7D)()

4. Edit this ID

Same as "Go to this ID" but it also takes you directly to the Edit form of the target page. So this is a shortcut for going to a page with a given ID and then hitting the "Edit" button once on the page.

javascript:(function()%7Bvar%20target%20%3D%20prompt(%22Target%20ID%3A%22)%3Bif%20(target%20!%3D%20null)%20%7Blocation.href%20%3D%20document.URL.substr(0%2Cdocument.URL.lastIndexOf('%2F'))%20%2B%20%22%2F%22%20%2B%20target%20%2B%20%22.html?dired=1%22%3B%7D%7D)()

5. Show Publish Status

If your store is in the middle of publishing and you don't have the publish status screen in front of you, this bookmarklet will take you to that page from any page of your live store.

javascript:var%20re%20=%20new%20RegExp('/cgi-bin/wg-order[?]([a-z0-9-]+)');var%20m%20=%20document.body.innerHTML.match(re);%20if%20(m)%20{document.location.href='http://edit.store.yahoo.com/RT/MGR.'%20+%20m[1]%20+%20'/NEWEDIT_STATUS';}


Enjoy!

Comments

Popular posts from this blog

CPR for a Yahoo Store on Google's Supplemental Index

Recently a client of mine came to me and said that most of his store pages disappeared from Google, and he did not do anything to make this happen. I was a bit skeptical, so I went to Google, did a search on his store, and sure enough, there were only two pages indexed, his home page and his site map (ind.html) page. The rest were in the supplemental results, which means that Google thought the rest of the pages were not much different than these two pages. When I looked at the supplemental results, the little excerpts under each link were exactly the same, and I also noticed that what Google showed under each result was actually text from the ALT tags of the header image. I looked at some of these pages in my client's store, and they were actually different. This was a bit puzzling, but then I thought perhaps Google saw that the header and left navigation was the same throughout the site (which is pretty normal), but that the text that made each page different was too far down ins

How to create clean and efficient CSS

In a typical workday, I deal with dozens of yahoo stores and very often I have to tweak, fix, or change CSS used by these stores. While some stores have very clean and easy to follow style sheets or CSS definitions, the vast majority of stores I've seen seem to include complete hack jobs, style sheets put together completely haphazardly, or as an afterthought. While working in such a store, the idea came to me to turn my gripes into a post. So the following is my list of dos and don'ts of good CSS or style design. 1. Externalize your style sheets. This means to save your style sheets into one or more css files, and link to them using the <link rel="stylesheet" type="text/css" href="/lib/yourstoreid/yourstyle.css"> notation, or in Editor V3.0, you can use the LINK operator. 2. Combine your style sheets into as few files as possible. Nothing worse than trying to wade through 6, 8, 10 or more different style sheets to find the color of a l

What to expect when your redesign goes live

At Y-Times we roll out new designs, redesigns and other major upgrades to Yahoo stores on a fairly regular basis. Some of the main questions our clients ask are how to prepare for a roll-out and what to expect in terms of SEO and conversions when the changes go live? For any functional Yahoo store how well the site ranks and how well it converts are probably the two most important metrics. Since pretty much ANY change you make to any page can potentially alter either or both of these metrics, merchants may understandably feel nervous about far reaching alterations to their sites. However, when those functionality and design changes and additions are done right, there is really very little to fear. First off, what does it mean for a design or redesign to be "done right?" From the technical stand point, search engines look at the underlying structure of your site (the HTML, and increasingly also the CSS and JavaScript code) to try to extract information and meaning from i