Question

Drill using a favicon

  • 1 June 2015
  • 1 reply
  • 614 views

Userlevel 4
Badge

###Objective

Similar to drilling with a sparkline, we may also use favicons as the linked path. In this particular example, I’ll be using the Salesforce and Gmail favicons to create a Look that displays customer names along side links to their Salesforce account and email. The possibilities here are endless (as long as the supply for public favicons is endless).


###How do we do it?


The favicons are sourced from Salesforce and some blog on the interwebs. Self-hosted Looker customers can add custom images and use the same syntax to add images to a dimension/measure. We then use the html: parameter to force a link through the favicon.


Make sure to note that the link is stored in the a href="..." and the favicons are simply used as the linked values. The purpose of {{ contact.email._value }} is to allow the html to grab the value of contact.email in the given row, while allowing the dimension to output the contact.name.


  - dimension: salesforce
sql: ${TABLE}.Id
html: |
<a href="https://na9.salesforce.com/{{ value }}" target="_blank">
<img src="http://www.salesforce.com/favicon.ico" height=16></a>

- dimension: name
sql: ${TABLE}.Name
html: |
<a href="mailto:{{ contact.email._value }}" target="_blank">
<img src="http://blog.jayare.eu/wp-content/uploads/2009/01/gmail-favicon.jpg" height=16></a>
{{ rendered_value }}

###What does it look like?

Imagine the blurred parts are our customers’ names. The gmail icon will link out to mailto: and the salesforce icon links directly to the account related to that contact.



1 reply

Userlevel 1

This is now even easier with drill menus! Set a mailto link using drill field URLs

Reply