CyberNotes
Web Browser Wednesday


One of my favorite additions to the Firefox 3 browser (currently in Beta) are Smart Bookmarks. There’s a good chance that you’ve played with things in other applications that are similar to Smart Bookmarks. For example, iTunes (and many other media players) have what are referred to as Smart Playlists. These are playlists that automatically assemble themselves based on specific criteria, such as the “most played” and “recently added” media. Smart Bookmarks are very similar since they can show you things like your most visited bookmarks or your recently added bookmarks:

firefox smart bookmarks.png

Just a few weeks ago we showed you how to quickly restore the default Smart Bookmarks that come with the browser, but did you know that it’s also possible to make your own? Thanks to the new bookmarks backend that Mozilla has implemented it’s actually pretty easy for you to create your own Smart Bookmarks once you understand how they work. An extension will inevitably come along that makes this a no-brainer, but it will take you no time to catch on to manually creating them.

The first thing we’re going to do is show you the steps needed to create a new Smart Bookmark, and then we’re going to give you an overview of the query syntax you’ll want to use to take things up a notch.

–Creating a Smart Bookmark–

There are a few different ways that you can create a Smart Bookmark, but I’m going to show you the one that I believe is the easiest.

  1. Open up the Bookmarks Organizer by going to the Bookmarks Menu, and click the Organize Bookmarks option.
    firefox organize bookmarks.png
  2. Click the Organize Menu and choose the New Bookmark option:
    firefox new bookmark-1.png
  3. Now you need to type in whatever name you would like for the Smart Bookmark. In the location field, however, is where you will insert the specialized “URL” which we’ll cover in the next section. This screenshot shows an example location that will return the top 10 bookmarks you visit the most:
    firefox add smart bookmark.png
  4. The Smart Bookmark that you just created should now be visible in the Bookmark Organizer, and you can place it wherever you would like. The content will dynamically change based on the criteria that you specified in the previous step.
    firefox smart bookmark example.png

–Smart Bookmarks Queries–

In Step 3 above you were told to insert a specialized URL into the location field of the bookmark. This is really the thing that differentiates a Smart Bookmark from a regular bookmark. Each location field for a Smart Bookmark will start with “place:” followed by a few parameters that tell the bookmark what its contents should contain. You’ll also notice that each parameter is separated by an ampersand (&).

Want some examples? Here are a few to get your creative juices flowing:

  • 10 Most Visited Sites:
    place:queryType=0&sort=8&maxResults=10
  • 10 Most Recent Bookmarks:
    place:queryType=1&sort=12&maxResults=10
  • 15 Most Visited Bookmarks:
    place:queryType=1&sort=8&maxResults=15
  • 10 Most Visited Sites with “CyberNet” in them:
    place:queryType=0&sort=8&maxResults=10&terms=cybernet
  • 5 Most Visited Sites at the cybernetnews.com Domain:
    place:queryType=0&sort=8&maxResults=5&domain=cybernetnews.com

Looking at some of those examples there is a good chance that you picked up on how the queries work. Over at the Mozilla forum they have begun assembling a rather comprehensive list of parameters that you can use with the queries, but there are quite a few that most of you won’t use when creating these manually. Here are some of the more useful ones that I used in the examples above, along with a brief description of the values that go with them:

  • sort – This is used in all of the examples above, and this is what determines the order in which the bookmarks are sorted. A majority of the examples I gave use a sort value of “8″, which organizes the results according to the largest visit count first. Here are all the values that you can use with it:

    • 0 – Natural bookmark order
    • 1 – Sort by title, A-Z
    • 2 – Sort by title, Z-A
    • 3 – Sort by visit date, most recent last
    • 4 – Sort by visit date, most recent first
    • 5 – Sort by uri, A-Z
    • 6 – Sort by uri, Z-A
    • 7 – Sort by visit count, ascending
    • 8 – Sort by visit count, descending
    • 9 – Sort by keyword, A-Z
    • 10 – Sort by keyword, Z-A
    • 11 – Sort by date added, most recent last
    • 12 – Sort by date added, most recent first
    • 13 – Sort by last modified date, most recent last
    • 14 – Sort by last modified date, most recent first
    • 17 – Sort by tags, ascending
    • 18 – Sort by tags, descending
    • 19 – Sort by annotation, ascending
    • 20 – Sort by annotation, descending
  • queryType – This is also used in all of the examples above. It’s used to specify whether you want to search the History (a.k.a. sites you’ve visited), Bookmarks, or both.
    • 0 – Searches only your History
    • 1 – Searches only your Bookmarks
    • 2 – Searches both your History and Bookmarks
  • maxResults – Use this to specify how many results you want returned.
    • 0 – Return all results
    • 1 to ?? – Any number besides “0″ will indicate the number of results you want returned
  • domain – Specify the domain of a site, such as “cybernetnews.com” as seen in the example above.
  • terms – Word(s) that you want to search for. From what I gather it searches most areas of your sites/bookmarks including the title.

The different parameters that I just covered are only a small amount of what’s actually available, but they are the ones that have proven to be the most useful to me. If you get overly ambitious you can checkout the full selection.

–Overview–

It’s inevitable that there will be an extension that makes it easier to configure these Smart Bookmarks, but it’s actually not that hard to manually create them. Although it could get tedious if you wanted to make a bunch of them.

Now we would like to turn things over to you. Let us know in the comments what kind of concoctions you come up with so that more of us can benefit from your infinite wisdom!

  1. Nice tip! Thanks

  2. William Becher wrote:
    Nice tip! Thanks

    No problem… that’s what we’re here for.

  3. For all you Evernote 3.0 beta users – the last 10 pages you clipped:

    place:terms=%22Evernote%20Clip%3A%22Clip&sort=8&maxResults=10

  4. Hmmm, seems while it gives you a sort of view of the Evernote clips in the smart bookmarks menu, the links themselves aren’t very useful, leading back to your account or to the “add web clip” Evernote page again.

  5. Dee wrote:
    Hmmm, seems while it gives you a sort of view of the Evernote clips in the smart bookmarks menu, the links themselves aren’t very useful, leading back to your account or to the “add web clip” Evernote page again.

    Huh, it was a nice thought. ;)

  6. Found a mistake, it should be:

    # 10 Most Recent Bookmarks:
    place:queryType=1&sort=12&maxResults=10

  7. noroom wrote:
    Found a mistake, it should be:

    # 10 Most Recent Bookmarks:
    place:queryType=1&sort=12&maxResults=10

    Ahh, thanks. I fixed it in the article.

  8. Have you seen this article? A portion of this can be done through the GUI. I just want to figure out how to filter OUT terms for a smart bookmark.

    [support.mozilla.com]+Bookmarks+folders#

  9. bfos7215 wrote:
    Have you seen this article? A portion of this can be done through the GUI. I just want to figure out how to filter OUT terms for a smart bookmark.

    [support.mozilla.com]+Bookmarks+folders#

    Yes, I have seen that article. Unfortunately Mozilla didn’t get all of the Smart Bookmarks configurability into the GUI like they originally wanted to, but from what I gather a more advanced Smart Bookmark generator will be available in Firefox 3.1 that is released later this year.

  10. You can also change the folder image in your userChrome.css by adding:

    .bookmark-item[container="true"][label="YOUR FOLDER NAME"] {
    list-style-image: url(”CUSTOM FOLDER IMAGE”) !important;
    -moz-image-region: rect(0px 16px 16px 0px) !important;
    }

    For example, if you wanted the folder called “10 Most Visited” to have the default image for smart folders, you’d add:

    .bookmark-item[container="true"][label="10 Most Visited"] {
    list-style-image: url(”chrome://browser/skin/places/query.png”) !important;
    -moz-image-region: rect(0px 16px 16px 0px) !important;
    }

    For more info, see:
    [forums.mozillazine.org]

  11. Thanks for the documentation, much appreciated.

    The “Smart” stuff has certainly been abused. This has got to be the third to fifth definition/usage of “Smart Bookmarks” from keyword as an alias, keyword with an operand, tags, and as a places bookmark which is really a places query and looks like a folder.

    The support (HELP) article uses
    “Smart Bookmarks Folders” — [support.mozilla.com]+Bookmarks+Folders but I guess that was for table of contents or search engines, as it refers inside the article to them as “Smart Folders” whether distributed with Fx3 or if you created them yourself with a bookmarks and/or history search, or as in your article creating them more more generically/ And “Smart Folders” is what you called them in your 2007-10-11 article.

  12. the whole “smart folder” thing has confused me for a while now, thanks for clearing things up

  13. Thanks a lot, works great.

    One thing I’ve sumbled upon: One can’t change the smart folders name or it’s content-fomula afterwards.

  14. Correction: works fine if you restart firefox

  15. How do you edit an existing smart bookmark ?

  16. JD wrote:
    How do you edit an existing smart bookmark ?

    You can right-click on it and select Properties. Or you can click on the yellow star in the address bar after the page has been bookmarked.

  17. Can I make a smart bookmark that excludes a certain domain?

  18. J. Parshall wrote:
    Can I make a smart bookmark that excludes a certain domain?

    You could try putting a minus sign “-” in front of the domain, but I’m not very confident that will work.

  19. Ryan wrote:
    JD wrote:
    How do you edit an existing smart bookmark ?

    You can right-click on it and select Properties. Or you can click on the yellow star in the address bar after the page has been bookmarked.

    Firefox for Mac will not let you edit smart bookmarks at all, because there IS no “Properties” menu for Smart Bookmarks. Any other way around it, or do I have to start over and recreate a new smart bookmark?

  20. [quote]JD wrote:

    How do you edit an existing smart bookmark ?

    You can right-click on it and select Properties. Or you can click on the yellow star in the address bar after the page has been bookmarked.
    [/quote]

    I’m missing something here. I don’t get a uri in the properties. All I get is the name of the bookmark.

  21. I like to add color to my bookmarks.
    So that when the Bookmark drop down menu appears
    it is easy to spot what I want.
    Example:
    Red for News sites
    Yellow for science and technology
    Blue for Energy
    and so.
    Can anyone here help?
    Thanks