YAP code sample: Cross-view font styling

Would you like to set consistent font styles for different YAP views, e.g., small and canvas? The code below demonstrates one way to do this.


  • Create a YAP app in the YDN dashboard:
  • Copy/paste this code into the base file of your app, eg if your app’s base url is http://example.com/index.php, put this code in index.php
  • Set the following as your default small view code: <yml:include params="?view=small">loading...</yml:include>


  • PHP w/ short tags enabled
  • A server accessible via a domain name and capable of receiving POST requests (YAP sends user data via POST with the request for content)


For those using a feed reader, you can see the code on Github

This code has a BSD license detailed, along with usage instructions and other information, in the code’s readme file.

Erik Eldridge

Yahoo! Developer Network (@ydn)