|
|
(One intermediate revision by the same user not shown) |
Line 1: |
Line 1: |
| == Directory Tiles ==
| | #REDIRECT [[Tiles/Technical Documentation]] |
| | |
| For information about the ''progress and plans'' for Directory Tiles see the [[Content services]] page. This page is purely about the technical details of Directory Tiles.
| |
| | |
| === Technical Details ===
| |
| | |
| This technical information on how Directory Tiles are saved and how you as a Firefox user change it designed for advanced users or enterprise implementers who want to get their hands dirty.
| |
| | |
| '''NOTE''': If you're looking to customize your new tab page see the [https://support.mozilla.org/en-US/kb/new-tab-page-show-hide-and-customize-top-sites New Tab Page Customize] support document.
| |
| | |
| Directory Tiles are currently shipped with Desktop Firefox Nightly for en-US builds in the ''chrome://global/content/directoryLinks.json'' location. You can open that link up in Firefox to see how it is currently formatted and filled.
| |
| | |
| Directory Tiles are only available to users with little or no history (new users) in their profile. Once you've used Firefox to view a number of sites your new tab page will no longer show Directory Tiles automatically.
| |
| | |
| ==== Preferences ====
| |
| | |
| The main preference for Directory Tiles is this:
| |
| | |
| browser.newtabpage.directorySource = chrome://global/content/directoryLinks.json
| |
| | |
| This preference tells Firefox where to locate the Directory Tiles to use.
| |
| | |
| ===== Turning Directory Tiles Off =====
| |
| | |
| '''NOTE''': If you're looking to customize your new tab page see the [https://support.mozilla.org/en-US/kb/new-tab-page-show-hide-and-customize-top-sites New Tab Page Customize] support document.
| |
| | |
| If you wanted to turn off Directory Tiles through the preferences you could change the above preference to look like this:
| |
| | |
| browser.newtabpage.directorySource = data:application/json,{}
| |
| | |
| Changing to this preference will revert you to displaying all blank tiles on the new tab page.
| |
| | |
| ===== Customizing Directory Tiles =====
| |
| | |
| If you wanted to have a different set of Directory Tiles for example for an Enterprise rollout you can also customize the links provided.
| |
| | |
| Here's an example of a custom directory tiles preference:
| |
| | |
| browser.newtabpage.directorySource
| |
| | |
| data:application/json,{
| |
| "en-US": [
| |
| {
| |
| "url" : "http://www.mozilla.org/",
| |
| "bgColor" : "%234d4e54",
| |
| "type": "custom",
| |
| "imageURI": "data:image/png;base64,i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N9OF%2B%2BlPFmcJuUCzf3Po%2Fh5Dr6s29ONYwxCTfKyHEGyGYl0gKYZDj2U9pVRS3W808cfQz2IFIkyZj5i0oBJrEBKjoUdxFG9nuMEfQxdEmGsI1mjEZC%2FW60iMhp5HZKdo4I%2Bh50Q4Hh7Bsg88n8MqRWI0dIBwFfzECXOTdBzxx9ATI5zRo7AGYx%2FgWx1jNvRhrJX0ozUNSeEKIUf9MvQDWFMQk5lYd2h%2FGmsWEqOhO2EtNteHKkIO%2B2XoplwGtQgxeRvUSW0%2FwdqH1GvoSlI8hl6g7QisttrfBeqQX4YWPgf1FWJyDNR7TvckVhUpdRg6HdQ1bvG4Y12o7QSslq73oyX%2BGXoIVlePL8F0QxDuxKrkPqQOQ9%2BLlezx93rV4xqRqX17UBf9M7QQBHWeCbSmBeO4Uu3pXXNKsUrIYlhYRpLkOXQbz7vQt0Ad1LYb1iHnVO%2FFfqxh%2Fhk6FbAq%2BAPrvPPtueGA9RfVnaah59DCMaydPOz0U7FKWOt62T3PJnYQ7hyZfhlayMfbZdJqfpWagUQYugALtjl9S8I47zmO2gjGfuh0FD%2BYPtvjrq0QRQ5iEqAMN0G6mCcONWvlDG3dbb43egBcT%2BqJWPCafd4Y8b%2Foyuka%2B6E7UOwkyBrTdze9PQsXEtQ%2F6YnY0IjZFNmDgW94CjEZTHHEBHlTB91u%2BtsQM%2FUbVJj36Gt%2BqoIo1ms%2Fi9NYUEw%2FhNkAQIY%2Fv0DTiVzGMJps2iExSgqPMpknCJBCEmLSh%2FFMZgTpNDJtY%2FJZyga2spFXGKr9SIoYhfwXh%2F6nHToQAQAAAADkb73IbXCjR49u9OhGjx7d6NGNHj260aMbPXp0o0c3evToRo8OZGoOg%2BFHUXQAAAAASUVORK5CYII%3D",
| |
| "title": "Mozilla%20Foundation"
| |
| }
| |
| ]
| |
| }
| |
| | |
| ==== JSON Format ====
| |
| | |
| The JSON format is fairly simple, the top level needs to be a locale that Firefox understands. This allows you to offer multiple locales in a single JSON file.
| |
| | |
| At a high level the data format looks like this:
| |
| | |
| { "LOCALE" : [ ARRAY OF DIRECTORY TILE OBJECTS ] }
| |
| | |
| You can have many locales if you want to support multiple languages.
| |
| | |
| e.g.
| |
| { "en-US" : [ ARRAY OF US DIRECTORY TILES ], "en-CA" : [ ARRAY OF CA DIRECTORY TILES ] }
| |
| | |
| Each Directory Tile object requires a few items, most of which are self explanatory.
| |
| | |
| {
| |
| "url" : "http://www.mozilla.org/",
| |
| "bgColor" : "%234d4e54",
| |
| "type": "custom",
| |
| "imageURI": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAABWCAQAAADMSHQwAAAFWklEQVR4AezBgQAAAACAoP2pF6kCAAAAAAAAAABgdu0sNqoyDOP4C1WWgCylKgqKoNRCqaxCiyx2bBGNAVrCJkRkUYFAMEGNVUjYRIIIuAYlBqKAUSBcWEUIBlDCBRU6pKINCAUU0CibbSyL9e%2FNmTdvpudMF2ZGj5nfc%2FcwyZCH6Xd6DlMXTGUbe1jEjYhJMgEK2M5WGiDYZDCJ1QTJRWId4f%2BTDwkpoanT5bKXcgDgEqJpyFrKCJmWGLr2ycNa4rQzQf1OY0RzFdTziaFrn41Yh%2FQTjSqnBaLZA2puYujaZy3Wt06bBepPkhFNIaj5iaFrn4FY0522F3boNohmE6gFiaHrkvmEbNQuw3PoDYlPdP0zmOWsYoRpunkOvT4xdDTj%2F6FpS3vESTo5ZNMBwaYBGeQQIBWJmNsZRB7DybJD1DvN6EE%2BraM0dGdyGct4HiMj3kM3pzdz%2BIzLnEIQ5lJKyC6ynVfdxFJOEPKd52%2Bqk9jNNUIq2MYYBJtxlNSQxc4%2F64t8ykEuAJB63UNns5ojWMdZRqv4DV0IahL7CTcN4UHOEO5rkhBsulOEm13Yn40CalKIICRhdbiOoZOYQRHufqFvvIZeTkgV7t7F3TLEpD%2FeLtIRcTKLmqxz5vk5KkM%2FQxmRXCU5PkPnUF%2BXzGf6VqqI5FeaOK98mer%2BxiqM6tDvUJMV8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YUEw%2FhNkAQIY%2Fv0DTiVzGMJps2iExSgqPMpknCJBCEmLSh%2FFMZgTpNDJtY%2FJZyga2spFXGKr9SIoYhfwXh%2F6nHToQAQAAAADkb73IbXCjR49u9OhGjx7d6NGNHj260aMbPXp0o0c3evToRo8OZGoOg%2BFHUXQAAAAASUVORK5CYII%3D",
| |
| "title": "Mozilla%20Foundation"
| |
| }
| |
| | |
| '''NOTE''': You need to URL escape all the text, in the bgColor you'll see the # is replaced with %23 and the spaces are replaced with %20 in the title.
| |
| | |
| ''Directory Tiles Object Attributes''
| |
| | |
| * '''url''' is the link you want the Tile to link to
| |
| * '''bgColor''' provides a background fill color in case the image doesn't fill the space
| |
| * '''type''' isn't necessary for custom tiles so please use the 'custom' attribute
| |
| * '''imageURI''' provides the full URL to the image you want centered. Images need to be properly sized for the Tiles and do not use remote 'http' images here, only data URIs.
| |
| * '''title''' provides the display text that will appear below the Tile and for the link title attribute.
| |