DrupalEasy.com Podcast Ryan, Andrew, Mike @drupaleasy iTunes reviews welcome!
Ryan Price Web Developer Podcaster / Blogger Trainer / Mentor Community Builder Tummeler (noisemaker)
1 The good old days http://www.flickr.com/photos/nypl/3110144750/
” If you only have a hammer, everything is a nail.” Everything is a Node (CCK) http://www.flickr.com/photos/nlscotland/470...
Everything is a Node <ul><li>Media as nodes </li><ul><li>Photos++, Video, Audio </li></ul><li>eCommerce Products </li><ul>...
Theatre Show / Performances </li></ul><li>Nodereference </li><ul><li>Include the body of one node in another
Only goes in one direction </li></ul></ul>
Some Hybrids <ul><li>User Profiles as nodes </li><ul><li>Easier to add and manipulate fields
Now same content on two URLs </li></ul><li>Location </li><ul><li>Is it a node or something else? </li></ul><li>Comments as...
2 http://www.gapingvoidgallery.com
“ More than hammers.” Entities and Bundles http://www.flickr.com/photos/nasacommons/4858566616
Nodes = Entity type, Content Types = Bundles Node (entity) Content Type (bundle) Title Created Updated Published Promoted ...
“Fieldable” Nodes Node (entity) Content Type (bundle) Title Created Updated Published Promoted Sticky Author Menu Settings...
* “Fieldable” Comments Comment (entity)   Comment/Content Type (bundle) Subject Created Status Author Email Homepage Admin...
** “Fieldable” Terms Taxonomy (entity) Vocabulary (bundle) Name Description Admin > Structure > Taxonomy > Tags > Manage F...
Module Support <ul><li>Fields </li><ul><li>(the artist formerly known as CCK) </li></ul><li>Search
Views
Token
Rules
Features
Translation / I18N </li></ul>
Media
Media
Media
Products Drupal Commerce
Drupal Commerce
Drupal Commerce Product Display (node) Product (entity)
Bulk add Products
User Profiles Profile2
Profile2
Proflie2
Profile2
Organic Groups
Organic Groups
Organic Groups
Organic Groups
Organic Groups
Organic Groups
3 Relationships
Nodereference User Reference Entity Reference Drupal Commerce
Relation
R elation <ul><li>New Entity that lives between others
Stores a list of Nodes, Users, etc
Fieldable!
Johan Falk - “Learn the Relation module” http://dev.nodeone.se/node/970 </li></ul>
Relation
“ Fields with Fields” Field Collection
Upcoming SlideShare
Loading in …5
×

From CCK to Entities in Drupal: New Power Tools

2,871 views

Published on

Drupal 7 introduced a new layer of abstraction - Entities. We are familiar with Nodes and Node Types, and all the power and flexibility we got from those in past versions of Drupal. However, adding new data models was not very attractive in old versions because of the power of tools like CCK and Views - Nodes were the king of all data types. Now Entities allow us to (somewhat) easily create new entity types or add "bundles" to existing types, and all Entities may now also have "Fields", which is the new name for CCK in Drupal Core. In this session, you'll get a brief history of some old-school solutions to common problems in Drupal, and the modern Entity-based solutions based on Taxonomy Terms, Users, Comments, Media and new types as-of-yet unimagined.

Published in: Technology, Business
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,871
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
27
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

From CCK to Entities in Drupal: New Power Tools

  1. 1. DrupalEasy.com Podcast Ryan, Andrew, Mike @drupaleasy iTunes reviews welcome!
  2. 2. Ryan Price Web Developer Podcaster / Blogger Trainer / Mentor Community Builder Tummeler (noisemaker)
  3. 3. 1 The good old days http://www.flickr.com/photos/nypl/3110144750/
  4. 4. ” If you only have a hammer, everything is a nail.” Everything is a Node (CCK) http://www.flickr.com/photos/nlscotland/4700300060/
  5. 5. Everything is a Node <ul><li>Media as nodes </li><ul><li>Photos++, Video, Audio </li></ul><li>eCommerce Products </li><ul><li>T-Shirt sizes, pricing rules </li></ul><li>Complex parent/child relationships </li><ul><li>Artist / Album, Album / Track, Author / Books
  6. 6. Theatre Show / Performances </li></ul><li>Nodereference </li><ul><li>Include the body of one node in another
  7. 7. Only goes in one direction </li></ul></ul>
  8. 8. Some Hybrids <ul><li>User Profiles as nodes </li><ul><li>Easier to add and manipulate fields
  9. 9. Now same content on two URLs </li></ul><li>Location </li><ul><li>Is it a node or something else? </li></ul><li>Comments as nodes </li><ul><li>Allows you to add fields, use Node API </li></ul><li>Blocks with fields? </li><ul><li>Writing custom code, can't use CCK </li></ul></ul>
  10. 10. 2 http://www.gapingvoidgallery.com
  11. 11. “ More than hammers.” Entities and Bundles http://www.flickr.com/photos/nasacommons/4858566616
  12. 12. Nodes = Entity type, Content Types = Bundles Node (entity) Content Type (bundle) Title Created Updated Published Promoted Sticky Author Menu Settings Comments* Admin > Structure > Content Types > Blog
  13. 13. “Fieldable” Nodes Node (entity) Content Type (bundle) Title Created Updated Published Promoted Sticky Author Menu Settings Comments* Admin > Structure > Content Types > Blog > Manage Fields
  14. 14. * “Fieldable” Comments Comment (entity) Comment/Content Type (bundle) Subject Created Status Author Email Homepage Admin > Structure > Content Types > Blog > Comment Fields
  15. 15. ** “Fieldable” Terms Taxonomy (entity) Vocabulary (bundle) Name Description Admin > Structure > Taxonomy > Tags > Manage Fields
  16. 16. Module Support <ul><li>Fields </li><ul><li>(the artist formerly known as CCK) </li></ul><li>Search
  17. 17. Views
  18. 18. Token
  19. 19. Rules
  20. 20. Features
  21. 21. Translation / I18N </li></ul>
  22. 22. Media
  23. 23. Media
  24. 24. Media
  25. 25. Products Drupal Commerce
  26. 26. Drupal Commerce
  27. 27. Drupal Commerce Product Display (node) Product (entity)
  28. 28. Bulk add Products
  29. 29. User Profiles Profile2
  30. 30. Profile2
  31. 31. Proflie2
  32. 32. Profile2
  33. 33. Organic Groups
  34. 34. Organic Groups
  35. 35. Organic Groups
  36. 36. Organic Groups
  37. 37. Organic Groups
  38. 38. Organic Groups
  39. 39. 3 Relationships
  40. 40. Nodereference User Reference Entity Reference Drupal Commerce
  41. 41. Relation
  42. 42. R elation <ul><li>New Entity that lives between others
  43. 43. Stores a list of Nodes, Users, etc
  44. 44. Fieldable!
  45. 45. Johan Falk - “Learn the Relation module” http://dev.nodeone.se/node/970 </li></ul>
  46. 46. Relation
  47. 47. “ Fields with Fields” Field Collection
  48. 48. Field Collection module <ul><li>http://drupal.org/project/field_collection
  49. 49. Adds a field that is the Create form for a new Entity type
  50. 50. Admin > Structure > Field-Collections </li><ul><li>Manage Fields, Manage Display </li></ul><li>See also field_collection_table project </li><ul><li>Formats the entity as a table instead of fields or a list of titles </li></ul></ul>
  51. 51. Field Collection module
  52. 52. Field Collection module
  53. 53. 4 View Modes (Build Modes, Node Display)
  54. 54. Entity View Mode
  55. 55. Entity View Mode
  56. 56. 5 Beyond Contrib
  57. 57. hook_entity_info() profile2 <ul><li>'label' => t('Profile'),
  58. 58. 'entity class' => 'Profile',
  59. 59. 'controller class' => 'EntityAPIController',
  60. 60. 'label' => t('Profile type'),
  61. 61. 'entity class' => 'ProfileType',
  62. 62. 'controller class' => 'EntityAPIController',
  63. 63. profile2_entity_info_alter()
  64. 64. profile2_get_types()
  65. 65. Wolfgang Ziegler (fago) http://wolfgangziegler.net/article/Drupalcity-Entity-API-talk-slides </li></ul>
  66. 66. Entity Construction Kit
  67. 67. Entity Construction Kit
  68. 68. RyanPriceMedia.com @liberatr slideshare.net/liberatr FloridaCreatives.com

×