• Like
  • Save
Drupal developer days 2011   custom formatters
Upcoming SlideShare
Loading in...5
×
 

Drupal developer days 2011 custom formatters

on

  • 652 views

A presentation from a session at the drupal developer days 2011 in Brussels.

A presentation from a session at the drupal developer days 2011 in Brussels.
http://bxl2011.drupaldays.org/bxl2011.drupaldays.org/node/303.html

Statistics

Views

Total Views
652
Views on SlideShare
652
Embed Views
0

Actions

Likes
1
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Drupal developer days 2011   custom formatters Drupal developer days 2011 custom formatters Presentation Transcript

    • Custom  forma+ers  Jochen  Verdeyen  Nicolas  Leroy   1.
    • Who are we?!   Nicolas Leroy ¬  http://drupal.org/user/3527 ¬  @nicolasleroy ¬  http://nicolasleroy.be!   Jochen Verdeyen ¬  http://drupal.org/user/310720 ¬  http://www.jover.be/ 2.
    • Agenda! Custom Formatters in Drupal 6 (CCK) ¬  Using custom formatters module ¬  Writing custom code ! Example: HR site! Custom Formatters in Drupal 7 (Core: Field API) ¬  Using custom formatters module ¬  Writing custom code ! Difference D6 – D7 ! Example: Coordinates – Google Static Maps 3.
    • 4.
    • Custom Formatters in D6!   A custom formatter can be used to change the output of a CCK field.!   Example: filefield 5.
    • CCK – Filefield Formatters !   Go to the filefield module ¬  Filefield.module (hook_field_formatter_info, hook_theme) ¬  Filefield_formatter.inc (theme hooks) 6.
    • CCK – Filefield Formatters 7.
    • How to add a custom formatter?!   Use the “custom formatters” module ¬  http://drupal.org/project/custom_formatters!   Write custom code 8.
    • Use the Custom Formatter module 9.
    • Your custom formatter 10.
    • Write custom code 11.
    • Write custom code! hook_field_formatter_info (CCK) ¬  Declares information about one or more field formatter types.! hook_theme ¬  Register a module (or theme’s) theme implementation.! theme_hook ¬  Generate a themed output. 12.
    • Example!   Real-life problem: Job section ¬  Job postings on website ¬  Applications online, saved as node ¬  View to show applications ¬  Some file names too long to display! http://my.www.devdays.be 13.
    • Example: problem 14.
    • Example: solution 15.
    • 16.
    • Custom Formatters in D7!   Custom Formatters module!   Write custom code ¬  Coordinates Field module ¬  Coordinates Formatter module 17.
    • Coordinates Field module Form Formatted 18.
    • Write custom code! hook_theme! hook_field_formatter_info ¬  D6: CCK hook_field_formatter_info ¬  CCK à D7 Field API! hook_field_formatter_info_alter! hook_field_formatter_view! hook_field_formatter_prepare_view! hook_field_formatter_settings_form! hook_field_formatter_settings_summary! http://api.drupal.org 19.
    • hook_themegoogle-static-map.tpl.php 20.
    • hook_field_formatter_info Default values 21.
    • hook_field_formatter_view coordinates formatter settings Google Static Map API implementation return variables 22.
    • hook_field_formatter_settings_form 23.
    • hook_field_formatter_settings_summary 24.
    • 25.
    • 26.