SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Front-End
     Development for
        Facebook
(it doesn’t have to make you want to kill yourself)
FBML & HTML
Most front-end development done with regular
html and css
FBML (Facebook markup language) provides special
tags to add FB-specific functionality
Example: To display a friend selector:
<fb:multi-friend-selector actiontext="Select
friends" rows="3"/>
You’ll probably use very little FBML (if you’re lucky)
Styling FB Elements
Some Facebook-generated elements can be styled
via css.
Standard share buttons can be re-styled quite a
bit, by overriding FB’s own classes:
.uiButtonMedium { padding:0; }
.fb_button_text { display:none !important; }
You can add your own colors, backgrounds, and
change its dimensions.
Some are more stylable than others. Just play.
Stuff that’s in an iFrame...forget it.
HTML Tips
Some tags can’t be used at all:
body, html, head, iframe
Did I mention you can’t insert iFrames in tabs? They
work fine on canvas pages.
No relative references of any kind, including images,
css and js files.
Relative hyperlinks okay, provided you’re linking to a
page in Facebook.
In tabs, all your images will be cached. Cache-buster:
photo.jpg?version=2
Image maps don’t work (beats me)
CSS Tips
Can include external css files, but only 2. Don’t use
@import.
External css files will be cached. Changes will require
cache-busting:
facebook.css?version=2
CSS included inline is not cached.
Keep your css files separate, but include them inline
via php to avoid caching and avoid the 2-css-file limit:
<style type="text/css">
   <?php echo file_get_contents("/path/to/css.css") ?>
</style>

Background images will still get cached.
More CSS Tips
Many CSS “hacks” are considered invalid and will be
stripped completely.
Includes the “star hack” for IE
@font-face is determined invalid and will be stripped.
So for now, can’t use new webfonts within tabs or
FBML canvas pages (canvas iframes are fine)
JavaScript Tips
Quite a bit of JavaScript can be used within Facebook
(if you do it their way).
Can’t include external js files in FBML, including jQuery
FBJS is augmented (crippled) version of JavaScript
Certain native JS methods can’t be used at all:
alert(), document.write()
Many native JS methods have their own FBJS
equivalents:
obj.value = ‘blah’       -> obj.setValue(‘blah’)
obj.className = ‘blah’   -> obj.setClassName(‘blah’)

Within a canvas iFrame, go nuts.
Page types in Facebook
  ie, where does a UI developer do their stuff?

 Static FBML tabs
 Application tabs
 Canvas FBML pages
 Canvas iFrame pages
Page types in Facebook
             Static FBML tabs
 Just paste in all your html, fbml and (inline) css
 and javascript into a field.
 Everything still needs externally hosted
 To add, do a search for ‘s tatic fbml’ and select ‘ dd
                                                   a
 to page’. Select a page you admin
 Go to that page and click ‘edit page’. Find the static
 FBML app and ‘edit’.
 Paste in your code and save.
 Edit app settings and add it as a tab to your page
Page types in Facebook
              Application Tabs
 Similar to Static FBML tabs. Same limitations
 apply.
 Code is pulled into the tab from your own external
 URL
 Benefits are:
   Easier updates
   Can use any back-end code prior to render (PHP,
   Ruby, .NET)
   Code can be in version control
Page types in Facebook
           Canvas FBML Pages
 Canvas pages are anything with apps.facebook.com
 as their URL.
 FBML Canvas pages have many of the same
 limitations as tabs.
 You can include iFrames via: <fb:iframe>
 You can include external js files, but they will be
 cached, just like css files. The js must be FBJS-
 compliant.
 Still can’t include jQuery, but can do whatever you
 want within an iFrame
Page types in Facebook
           Canvas iFrame Pages
 Created by setting ‘canvas type’ to ‘iFrame’ within
 your application’s settings.
 The app’s canvas pages will all be iFramed now,
 using the ‘canvas url’ specified in app settings.
 These pages can be normal pages, built like you’d
 build them for any “normal” website.
 If you need to utilize Facebook functionality
 (shares, likes, etc) you’ll need to either use the
 Javascript or PHP SDK’s to hook into the FB API.
Roadmap Update Alert!
 Some of what I just told you might soon be a lie

 August 19th, 2010, FB updates the developer
 roadmap. In Q4 they’ll be making page tabs iFramed
 If they don’t screw it up, this will be HUGE for UI devs
 “We don't recommend FBML for new developers. If
 you aren't already using FBML, you should instead
 implement your application within an iframe.

 “The one exception: if you absolutely must create an
 application that appears as a tab on a Facebook
 Page, you will need to use FBML for now; tabs do not
 currently support iframes directly. We will be
 transitioning tabs to iframes later this year.”
Reference Links
Official Facebook
    http://developers.facebook.com/docs/

    http://developers.facebook.com/docs/reference/fbml/

    http://developers.facebook.com/docs/fbjs

    http://developers.facebook.com/roadmap

Shameless Plugs
    http://fbmhell.com
    http://ihatemarkzuckerberg.com
Questions?
   Bueller?

Weitere ähnliche Inhalte

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Kürzlich hochgeladen (20)

Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Empfohlen

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Empfohlen (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

Front-End Development for Facebook

  • 1. Front-End Development for Facebook (it doesn’t have to make you want to kill yourself)
  • 2. FBML & HTML Most front-end development done with regular html and css FBML (Facebook markup language) provides special tags to add FB-specific functionality Example: To display a friend selector: <fb:multi-friend-selector actiontext="Select friends" rows="3"/> You’ll probably use very little FBML (if you’re lucky)
  • 3. Styling FB Elements Some Facebook-generated elements can be styled via css. Standard share buttons can be re-styled quite a bit, by overriding FB’s own classes: .uiButtonMedium { padding:0; } .fb_button_text { display:none !important; } You can add your own colors, backgrounds, and change its dimensions. Some are more stylable than others. Just play. Stuff that’s in an iFrame...forget it.
  • 4. HTML Tips Some tags can’t be used at all: body, html, head, iframe Did I mention you can’t insert iFrames in tabs? They work fine on canvas pages. No relative references of any kind, including images, css and js files. Relative hyperlinks okay, provided you’re linking to a page in Facebook. In tabs, all your images will be cached. Cache-buster: photo.jpg?version=2 Image maps don’t work (beats me)
  • 5. CSS Tips Can include external css files, but only 2. Don’t use @import. External css files will be cached. Changes will require cache-busting: facebook.css?version=2 CSS included inline is not cached. Keep your css files separate, but include them inline via php to avoid caching and avoid the 2-css-file limit: <style type="text/css"> <?php echo file_get_contents("/path/to/css.css") ?> </style> Background images will still get cached.
  • 6. More CSS Tips Many CSS “hacks” are considered invalid and will be stripped completely. Includes the “star hack” for IE @font-face is determined invalid and will be stripped. So for now, can’t use new webfonts within tabs or FBML canvas pages (canvas iframes are fine)
  • 7. JavaScript Tips Quite a bit of JavaScript can be used within Facebook (if you do it their way). Can’t include external js files in FBML, including jQuery FBJS is augmented (crippled) version of JavaScript Certain native JS methods can’t be used at all: alert(), document.write() Many native JS methods have their own FBJS equivalents: obj.value = ‘blah’ -> obj.setValue(‘blah’) obj.className = ‘blah’ -> obj.setClassName(‘blah’) Within a canvas iFrame, go nuts.
  • 8. Page types in Facebook ie, where does a UI developer do their stuff? Static FBML tabs Application tabs Canvas FBML pages Canvas iFrame pages
  • 9. Page types in Facebook Static FBML tabs Just paste in all your html, fbml and (inline) css and javascript into a field. Everything still needs externally hosted To add, do a search for ‘s tatic fbml’ and select ‘ dd a to page’. Select a page you admin Go to that page and click ‘edit page’. Find the static FBML app and ‘edit’. Paste in your code and save. Edit app settings and add it as a tab to your page
  • 10. Page types in Facebook Application Tabs Similar to Static FBML tabs. Same limitations apply. Code is pulled into the tab from your own external URL Benefits are: Easier updates Can use any back-end code prior to render (PHP, Ruby, .NET) Code can be in version control
  • 11. Page types in Facebook Canvas FBML Pages Canvas pages are anything with apps.facebook.com as their URL. FBML Canvas pages have many of the same limitations as tabs. You can include iFrames via: <fb:iframe> You can include external js files, but they will be cached, just like css files. The js must be FBJS- compliant. Still can’t include jQuery, but can do whatever you want within an iFrame
  • 12. Page types in Facebook Canvas iFrame Pages Created by setting ‘canvas type’ to ‘iFrame’ within your application’s settings. The app’s canvas pages will all be iFramed now, using the ‘canvas url’ specified in app settings. These pages can be normal pages, built like you’d build them for any “normal” website. If you need to utilize Facebook functionality (shares, likes, etc) you’ll need to either use the Javascript or PHP SDK’s to hook into the FB API.
  • 13. Roadmap Update Alert! Some of what I just told you might soon be a lie August 19th, 2010, FB updates the developer roadmap. In Q4 they’ll be making page tabs iFramed If they don’t screw it up, this will be HUGE for UI devs “We don't recommend FBML for new developers. If you aren't already using FBML, you should instead implement your application within an iframe. “The one exception: if you absolutely must create an application that appears as a tab on a Facebook Page, you will need to use FBML for now; tabs do not currently support iframes directly. We will be transitioning tabs to iframes later this year.”
  • 14. Reference Links Official Facebook http://developers.facebook.com/docs/ http://developers.facebook.com/docs/reference/fbml/ http://developers.facebook.com/docs/fbjs http://developers.facebook.com/roadmap Shameless Plugs http://fbmhell.com http://ihatemarkzuckerberg.com
  • 15. Questions? Bueller?