Live Tile support
Posted by eXonyte at 11:08 AM
After posting the previous article, I decided to make some tweaks and improvements to the Realm. Aside from updating the MODX backend, I've also added Live Tile support. I realize that the majority of people will never use such a feature, but as someone who is heavily invested in current Microsoft platforms I found it to be an interesting exercise.
For anyone who doesn't want to read the whole article, here is the documentation on Microsoft's website. That should get you where need to go.
To be quite honest, the actual implementation took less time than tracking down the right documentation and support information. Microsoft provides a wizard that will generate a basic live tile if you provide a URL, an image, and optionally an RSS feed. Of course after going through this method, including writing up a resource to output RSS, I realized that I could just feed the live tile data directly. This would also give me control of the live tile format, since I really did not like the templates that the wizard sets up.
After doing more web searching than was probably necessary, I managed to track down all of the info I needed. Getting the basic XML format was easy, as the live tile wizard provides a sample that supports all three live tile sizes (the smallest tile size is static only). Once I had that, I started looking for the additional formatting options. After bouncing off of a few blogs I found my way to the the tile template catalog. While the tile formats here are listed for Windows and Windows Phone apps, they are also supported for pinned websites. After messing around a bit with tile formats and repeatedly pinning my site, I got it all working perfectly. The one caveat I came across was in my chosen large tile format. You provide an image URL and two text strings, and it uses the image as a background for the tile. After doing so, the smaller live tiles worked fine but the larger tile would not load anything. The problem was that I passed a relative URL instead of an exact URL. As soon as I changed to an exact URL everything worked beautifully. As a bonus, both Windows 8.1 and Windows Phone 8.1 offer nearly identical live tile support with the exception of the largest size.
The end result? Here are screenshots of the largest size live tiles on Windows Phone 8.1 and Windows 8.1 RT, respectively.