SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
Field/CCK Formatters
“God has given you one face, and you make yourself another.”
 - Fortune cookie in my desk drawer


                                                               Helior Colorado
                                                                  ihatespam@helior.info
What are Field Formatters?
What are Field Formatters?
• Means to present field data in a
 displaying entity
What are Field Formatters?
• Means to present field data in a
 displaying entity
• Is pluggable
What are Field Formatters?
• Means to present field data in a
 displaying entity
• Is pluggable
• Provides a layer of configurability
What are Field Formatters?
• Means to present field data in a
 displaying entity
• Is pluggable
• Provides a layer of configurability
• Is extendable via various methods
What are Field Formatters?
• Means to present field data in a
 displaying entity
• Is pluggable
• Provides a layer of configurability
• Is extendable via various methods
• If done right, can be reused in any
 site
Defining a Field Formatter:
hook_field_formatter_info()


label

description

field types

multiple values

settings
Rendering a Field Formatter:
hook_field_formatter_view()


Return an array or renderable
arrays – “N is the only number”
Providing configurations:
hook_field_formatter_settings_form()



Standard Form API stuff.

Returning a new form element.

This will help:
$display = $instance['display'][$view_mode];
$settings = $display['settings'];
Displaying configuration summary:
hook_field_formatter_settings_summary()




Output a string of whatever you
think is meaningful.
Pre-build formatter processing:
hook_field_prepare_view()




Custom data massaging goes
here.

Rarely used.
Review the steps:
Review the steps:
• Define formatter
  hook_field_formatter_info()
Review the steps:
• Define formatter
  hook_field_formatter_info()



• Return array of renderable arrays
  hook_field_formatter_view($entity_type, $entities, $field, $instances, $langcode, &
  $items, $display)
Review the steps:
• Define formatter
  hook_field_formatter_info()



• Return array of renderable arrays
  hook_field_formatter_view($entity_type, $entities, $field, $instances, $langcode, &
  $items, $display)



• Optionally provide settings
  hook_field_formatter_settings_form($field, $instance, $view_mode, $form, &
  $form_state)
Review the steps:
• Define formatter
  hook_field_formatter_info()



• Return array of renderable arrays
  hook_field_formatter_view($entity_type, $entities, $field, $instances, $langcode, &
  $items, $display)



• Optionally provide settings
  hook_field_formatter_settings_form($field, $instance, $view_mode, $form, &
  $form_state)



• Optionally display settings summary
  hook_field_formatter_settings_summary($field, $instance, $view_mode)
Review the steps:
• Define formatter
  hook_field_formatter_info()



• Return array of renderable arrays
  hook_field_formatter_view($entity_type, $entities, $field, $instances, $langcode, &
  $items, $display)



• Optionally provide settings
  hook_field_formatter_settings_form($field, $instance, $view_mode, $form, &
  $form_state)



• Optionally display settings summary
  hook_field_formatter_settings_summary($field, $instance, $view_mode)



• Optionally prepare data before build
  hook_field_prepare_view($entity_type, $entities, $field, $instances, $langcode, &
  $items, $display)
Review the steps:
• Define formatter
  hook_field_formatter_info()



• Return array of renderable arrays
  hook_field_formatter_view($entity_type, $entities, $field, $instances, $langcode, &
  $items, $display)



• Optionally provide settings
  hook_field_formatter_settings_form($field, $instance, $view_mode, $form, &
  $form_state)



• Optionally display settings summary
  hook_field_formatter_settings_summary($field, $instance, $view_mode)



• Optionally prepare data before build
  hook_field_prepare_view($entity_type, $entities, $field, $instances, $langcode, &
  $items, $display)




Useful helpers:
Review the steps:
• Define formatter
  hook_field_formatter_info()



• Return array of renderable arrays
  hook_field_formatter_view($entity_type, $entities, $field, $instances, $langcode, &
  $items, $display)



• Optionally provide settings
  hook_field_formatter_settings_form($field, $instance, $view_mode, $form, &
  $form_state)



• Optionally display settings summary
  hook_field_formatter_settings_summary($field, $instance, $view_mode)



• Optionally prepare data before build
  hook_field_prepare_view($entity_type, $entities, $field, $instances, $langcode, &
  $items, $display)




Useful helpers:
• field_info_formatter_types()
• field_info_formatter_settings()
• field_view_field()
• field_view_value()
Ideas for Workshop
★ HTML5 Audio    playback controller        ★ Lightbox-likegallery for images
★ Email address “mailto:” link              ★ Custom date from timestamp
★ Link to Twitter account with selectable   ★ Fully customizable link from a path
  styles

Weitere ähnliche Inhalte

Ähnlich wie Field formatters

Fields in Core: How to create a custom field
Fields in Core: How to create a custom fieldFields in Core: How to create a custom field
Fields in Core: How to create a custom fieldIvan Zugec
 
Love Your Database Railsconf 2017
Love Your Database Railsconf 2017Love Your Database Railsconf 2017
Love Your Database Railsconf 2017gisborne
 
Oleksandr Masovets. Forms in Drupal. Drupal Camp Kyiv 2011
Oleksandr Masovets. Forms in Drupal. Drupal Camp Kyiv 2011Oleksandr Masovets. Forms in Drupal. Drupal Camp Kyiv 2011
Oleksandr Masovets. Forms in Drupal. Drupal Camp Kyiv 2011Vlad Savitsky
 
Introducing DataWave
Introducing DataWaveIntroducing DataWave
Introducing DataWaveData Works MD
 
Top 20 something info path 2010 tips and trips - sps-ozarks12
Top 20 something info path 2010 tips and trips - sps-ozarks12Top 20 something info path 2010 tips and trips - sps-ozarks12
Top 20 something info path 2010 tips and trips - sps-ozarks12Kevin Dostalek
 
Rapid Prototyping with PEAR
Rapid Prototyping with PEARRapid Prototyping with PEAR
Rapid Prototyping with PEARMarkus Wolff
 
Deep Dive into Salesforce Integrations: Mapping Engines
Deep Dive into Salesforce Integrations:  Mapping EnginesDeep Dive into Salesforce Integrations:  Mapping Engines
Deep Dive into Salesforce Integrations: Mapping EnginesCRMScienceKirk
 
DrupalCamp 2011 -- Poutine Maker
DrupalCamp 2011 -- Poutine MakerDrupalCamp 2011 -- Poutine Maker
DrupalCamp 2011 -- Poutine Makertavisharmstrong
 
Data Localization and Translation
Data Localization and TranslationData Localization and Translation
Data Localization and TranslationYevhen Shyshkin
 
PHP and Rich Internet Applications
PHP and Rich Internet ApplicationsPHP and Rich Internet Applications
PHP and Rich Internet Applicationselliando dias
 
Data localization and translation
Data localization and translationData localization and translation
Data localization and translationMotti Danino
 
One App Cloud - Custom CSS and Javascript
One App Cloud - Custom CSS and Javascript One App Cloud - Custom CSS and Javascript
One App Cloud - Custom CSS and Javascript One App Cloud
 
PHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersPHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersKacper Gunia
 
First Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentFirst Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentNuvole
 
Introduction to Advanced Custom Fields
Introduction to Advanced Custom FieldsIntroduction to Advanced Custom Fields
Introduction to Advanced Custom FieldsZero Point Development
 
Apostrophe (improved Paris edition)
Apostrophe (improved Paris edition)Apostrophe (improved Paris edition)
Apostrophe (improved Paris edition)tompunk
 

Ähnlich wie Field formatters (20)

Fields in Core: How to create a custom field
Fields in Core: How to create a custom fieldFields in Core: How to create a custom field
Fields in Core: How to create a custom field
 
Get on with Field API
Get on with Field APIGet on with Field API
Get on with Field API
 
Love Your Database Railsconf 2017
Love Your Database Railsconf 2017Love Your Database Railsconf 2017
Love Your Database Railsconf 2017
 
Oleksandr Masovets. Forms in Drupal. Drupal Camp Kyiv 2011
Oleksandr Masovets. Forms in Drupal. Drupal Camp Kyiv 2011Oleksandr Masovets. Forms in Drupal. Drupal Camp Kyiv 2011
Oleksandr Masovets. Forms in Drupal. Drupal Camp Kyiv 2011
 
The new form framework
The new form frameworkThe new form framework
The new form framework
 
Introducing DataWave
Introducing DataWaveIntroducing DataWave
Introducing DataWave
 
Refactoring
RefactoringRefactoring
Refactoring
 
Top 20 something info path 2010 tips and trips - sps-ozarks12
Top 20 something info path 2010 tips and trips - sps-ozarks12Top 20 something info path 2010 tips and trips - sps-ozarks12
Top 20 something info path 2010 tips and trips - sps-ozarks12
 
Rapid Prototyping with PEAR
Rapid Prototyping with PEARRapid Prototyping with PEAR
Rapid Prototyping with PEAR
 
Drupal 8: Fields reborn
Drupal 8: Fields rebornDrupal 8: Fields reborn
Drupal 8: Fields reborn
 
Deep Dive into Salesforce Integrations: Mapping Engines
Deep Dive into Salesforce Integrations:  Mapping EnginesDeep Dive into Salesforce Integrations:  Mapping Engines
Deep Dive into Salesforce Integrations: Mapping Engines
 
DrupalCamp 2011 -- Poutine Maker
DrupalCamp 2011 -- Poutine MakerDrupalCamp 2011 -- Poutine Maker
DrupalCamp 2011 -- Poutine Maker
 
Data Localization and Translation
Data Localization and TranslationData Localization and Translation
Data Localization and Translation
 
PHP and Rich Internet Applications
PHP and Rich Internet ApplicationsPHP and Rich Internet Applications
PHP and Rich Internet Applications
 
Data localization and translation
Data localization and translationData localization and translation
Data localization and translation
 
One App Cloud - Custom CSS and Javascript
One App Cloud - Custom CSS and Javascript One App Cloud - Custom CSS and Javascript
One App Cloud - Custom CSS and Javascript
 
PHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersPHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4Developers
 
First Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentFirst Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven Development
 
Introduction to Advanced Custom Fields
Introduction to Advanced Custom FieldsIntroduction to Advanced Custom Fields
Introduction to Advanced Custom Fields
 
Apostrophe (improved Paris edition)
Apostrophe (improved Paris edition)Apostrophe (improved Paris edition)
Apostrophe (improved Paris edition)
 

Mehr von Helior Colorado

Mehr von Helior Colorado (7)

Theming views
Theming viewsTheming views
Theming views
 
jQuery+Drupal Optimizations
jQuery+Drupal OptimizationsjQuery+Drupal Optimizations
jQuery+Drupal Optimizations
 
Apache Solr
Apache SolrApache Solr
Apache Solr
 
Rss Feeds
Rss FeedsRss Feeds
Rss Feeds
 
Web Standards
Web StandardsWeb Standards
Web Standards
 
The Internet (The Problem With...)
The Internet (The Problem With...)The Internet (The Problem With...)
The Internet (The Problem With...)
 
Using jQuery and CSS to manipulate style and markup
Using jQuery and CSS to manipulate style and markupUsing jQuery and CSS to manipulate style and markup
Using jQuery and CSS to manipulate style and markup
 

Kürzlich hochgeladen

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
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 SolutionsEnterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
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 AutomationSafe Software
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
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 MenDelhi Call girls
 

Kürzlich hochgeladen (20)

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
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
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 

Field formatters

  • 1. Field/CCK Formatters “God has given you one face, and you make yourself another.” - Fortune cookie in my desk drawer Helior Colorado ihatespam@helior.info
  • 2. What are Field Formatters?
  • 3. What are Field Formatters? • Means to present field data in a displaying entity
  • 4. What are Field Formatters? • Means to present field data in a displaying entity • Is pluggable
  • 5. What are Field Formatters? • Means to present field data in a displaying entity • Is pluggable • Provides a layer of configurability
  • 6. What are Field Formatters? • Means to present field data in a displaying entity • Is pluggable • Provides a layer of configurability • Is extendable via various methods
  • 7. What are Field Formatters? • Means to present field data in a displaying entity • Is pluggable • Provides a layer of configurability • Is extendable via various methods • If done right, can be reused in any site
  • 8. Defining a Field Formatter: hook_field_formatter_info() label description field types multiple values settings
  • 9. Rendering a Field Formatter: hook_field_formatter_view() Return an array or renderable arrays – “N is the only number”
  • 10. Providing configurations: hook_field_formatter_settings_form() Standard Form API stuff. Returning a new form element. This will help: $display = $instance['display'][$view_mode]; $settings = $display['settings'];
  • 14. Review the steps: • Define formatter hook_field_formatter_info()
  • 15. Review the steps: • Define formatter hook_field_formatter_info() • Return array of renderable arrays hook_field_formatter_view($entity_type, $entities, $field, $instances, $langcode, & $items, $display)
  • 16. Review the steps: • Define formatter hook_field_formatter_info() • Return array of renderable arrays hook_field_formatter_view($entity_type, $entities, $field, $instances, $langcode, & $items, $display) • Optionally provide settings hook_field_formatter_settings_form($field, $instance, $view_mode, $form, & $form_state)
  • 17. Review the steps: • Define formatter hook_field_formatter_info() • Return array of renderable arrays hook_field_formatter_view($entity_type, $entities, $field, $instances, $langcode, & $items, $display) • Optionally provide settings hook_field_formatter_settings_form($field, $instance, $view_mode, $form, & $form_state) • Optionally display settings summary hook_field_formatter_settings_summary($field, $instance, $view_mode)
  • 18. Review the steps: • Define formatter hook_field_formatter_info() • Return array of renderable arrays hook_field_formatter_view($entity_type, $entities, $field, $instances, $langcode, & $items, $display) • Optionally provide settings hook_field_formatter_settings_form($field, $instance, $view_mode, $form, & $form_state) • Optionally display settings summary hook_field_formatter_settings_summary($field, $instance, $view_mode) • Optionally prepare data before build hook_field_prepare_view($entity_type, $entities, $field, $instances, $langcode, & $items, $display)
  • 19. Review the steps: • Define formatter hook_field_formatter_info() • Return array of renderable arrays hook_field_formatter_view($entity_type, $entities, $field, $instances, $langcode, & $items, $display) • Optionally provide settings hook_field_formatter_settings_form($field, $instance, $view_mode, $form, & $form_state) • Optionally display settings summary hook_field_formatter_settings_summary($field, $instance, $view_mode) • Optionally prepare data before build hook_field_prepare_view($entity_type, $entities, $field, $instances, $langcode, & $items, $display) Useful helpers:
  • 20. Review the steps: • Define formatter hook_field_formatter_info() • Return array of renderable arrays hook_field_formatter_view($entity_type, $entities, $field, $instances, $langcode, & $items, $display) • Optionally provide settings hook_field_formatter_settings_form($field, $instance, $view_mode, $form, & $form_state) • Optionally display settings summary hook_field_formatter_settings_summary($field, $instance, $view_mode) • Optionally prepare data before build hook_field_prepare_view($entity_type, $entities, $field, $instances, $langcode, & $items, $display) Useful helpers: • field_info_formatter_types() • field_info_formatter_settings() • field_view_field() • field_view_value()
  • 21. Ideas for Workshop ★ HTML5 Audio playback controller ★ Lightbox-likegallery for images ★ Email address “mailto:” link ★ Custom date from timestamp ★ Link to Twitter account with selectable ★ Fully customizable link from a path styles