pres why entity_forms_italo_mairo_drupal_days_milano_8_may_2014

16
Milano - 8 Maggio @ 2014 - italomairo.com WHY ENTITY FORMS? The Case Study Management & Subscription of Editorial Plans in the Fiera Milano Media Drupal WebSite www.fieramilanomedia.it curated by Italo Mairo

Upload: italo-mairo

Post on 21-Jan-2017

473 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Pres why entity_forms_italo_mairo_drupal_days_milano_8_may_2014

Milano - 8 Maggio @ 2014 - italomairo.com

WHY ENTITY FORMS?

The Case StudyManagement & Subscription of Editorial Plans in the Fiera Milano Media Drupal WebSitewww.fieramilanomedia.it

curated by Italo Mairo

Page 2: Pres why entity_forms_italo_mairo_drupal_days_milano_8_may_2014

#DrupalDaysIT

Milano - 8 Maggio @ 2014 - italomairo.com

Why Entityforms?

Every skilled Drupalis knows Webforms. They have been widely used in the new institutional website of Fiera Milano Media.

But the Entityform Module/Approach has been the most effective for the implementation of sophisticated Management (by Internal users) & Subscription (by External users) system of Editorial Plans & Contents.

We will describe the logical approach and design, the structure of Ajax EntityForms able to dynamically expose Editorial Content (frontend) and the functional logic of subscriptions interfaces (Views) and their contents’ management (backend).

Page 3: Pres why entity_forms_italo_mairo_drupal_days_milano_8_may_2014

#DrupalDaysIT

Milano - 8 Maggio @ 2014 - italomairo.com

Entityform module (http://drupal.org/project/entityform)

As its creator, Ted Bowman, further explained on Thu 10/25/2012 in the following article:http://www.sixmiletech.com/content/why-entityforms-case-field-and-entity-based-survey-system-drupal

• Entityforms (differently from Webforms) are entities and use standard Drupal fields.

• Entityform submissions themselves are field-able entities.

This has many advantages including being able to use virtually any field module in Drupal. Now we can easily gather geographic information, reference site content and include media references in your surveys and other forms.• It also allows for simple integration with popular entity-aware modules.

With Entityforms thanks to the Entity API module, Rules and Views have complete knowledge of the submission information just as they do with the field values attached to other entities such as Nodes and Users. With Webform, while possible, the same process is not as simple.

• Also for programmers the process of interacting with Entityforms is much more familiar..  You can also use great helper classes such as the EntityFieldQuery and Entity Metadata Wrappers to make dealing with these entities much easier.

Page 4: Pres why entity_forms_italo_mairo_drupal_days_milano_8_may_2014

#DrupalDaysIT

Milano - 8 Maggio @ 2014 - italomairo.com

Fiera Milano Media - www.fieramilanomedia.itFiera Milano Media is the Fiera Milano group company specializing in the specialized press, in B2B communication, management training and digital services.

• 13 trade magazines• 9 web portals• 55 events / trade shows• 120 training courses

• 2 B2B databases with more than 700 thousand profiled users

• 2 outdoor venues*

Page 5: Pres why entity_forms_italo_mairo_drupal_days_milano_8_may_2014

#DrupalDaysIT

Milano - 8 Maggio @ 2014 - italomairo.com

Fiera Milano Media website (www.fieramilanomedia.it)has been developed (by me, on behalf of Crismaitalia srl) with Drupal 7 (since 2012)

let’s link in its bank-end (local link) ->

Page 6: Pres why entity_forms_italo_mairo_drupal_days_milano_8_may_2014

#DrupalDaysIT

Milano - 8 Maggio @ 2014 - italomairo.com

Webforms Data Collection in Fiera Milano MediaWebforms have been extensively used in the Fiera

Milano Media web site to collect different kinds of users subscriptions:http://fieramilanomedianew/it/admin/elenco_webforms

• Newsletter Subscription• Free copy request• Digital Magazine Subscription• etc

Page 7: Pres why entity_forms_italo_mairo_drupal_days_milano_8_may_2014

#DrupalDaysIT

Milano - 8 Maggio @ 2014 - italomairo.com

Each year, in advance, magazines’ editors and the company as a whole define the so-called “editorial plans”: annual programming, month by month numbers of different magazines and the main issues to be treated within them.

The Editorial Plan of each Magazine is defined through:

Magazine Number / Month > Editorial Contents (1 - n)

This schedule is released outwards, so that an external user (typically the company/press agency) may subscribe showing its interest in contributing at editorial level.

Fiera Milano Media Editorial Plans Subscriptions

Page 8: Pres why entity_forms_italo_mairo_drupal_days_milano_8_may_2014

#DrupalDaysIT

Milano - 8 Maggio @ 2014 - italomairo.com

Fiera Milano Media Editorial Plans SubscriptionsPrevious subscription method (and traditional), very complex:

External user:

• download pdf > print and fill > send back via email (and scan) or via fax

Fiera Milano Media Operator/Editor:

• Manual drafting of editorial plans, in pdf format

• Acquisition via fax/email of requests/subscriptions

• Manual archiving/management of requests, with transcript on spreadsheet or other formats

Page 9: Pres why entity_forms_italo_mairo_drupal_days_milano_8_may_2014

#DrupalDaysIT

Milano - 8 Maggio @ 2014 - italomairo.com

Fiera Milano Media Editorial Plans SubscriptionsNew way of Editorial Plan Subscription, via Drupal 7:

External user:

• Cditorial content selection and details subscription/submit via web

Fiera Milano Media Operator/Editor:

• Creating and archiving plans and editorial content, year by year, via the CMS backend

• Subscriptions and external user accounts management & storage, year by year, via the CMS backend

Page 10: Pres why entity_forms_italo_mairo_drupal_days_milano_8_may_2014

#DrupalDaysIT

Milano - 8 Maggio @ 2014 - italomairo.com

New Editorial Plans Subscriptions Approach & Analysis

We had the following needs:

• create the relational Editorial Plans Structure (Content Types in Drupal) and make the internal users able to input,create & manage these contents via CMS backend

• create Forms able to expose dynamic and relational contents (Entity Referenced) of the Editorial Plans Structure and get subscriptions from to external users

• manage and expose (with Views or whatever) Subcriptions and sub details (like Entities) strictly related to the Editorial Plans Contents (Entity Referenced)

Why Entity Forms above Webforms ?

All those task are:

• very hard (probably impossibile …) to be achieved with the Webform Module

• easy - logical (and quite natural) to be achieved with Entity Form Module

Page 11: Pres why entity_forms_italo_mairo_drupal_days_milano_8_may_2014

#DrupalDaysIT

Milano - 8 Maggio @ 2014 - italomairo.com

Creation & Management of Editorial Plans Structure

Creation of Drupal Content Types:

Drupal implementation

Magazine Editorial Plan (magazine, number, month year, etc)

Editorial Contents (Title, Section, Description, etc.)

1n (as entity references)

Creation of Drupal Management Relational Logics & Views, throughout specific administration links/hook_menus, administration & management viewsExample Links/Views (local links): http://fieramilanomedianew/it/elenco-piani-editoriali http://fieramilanomedianew/it/content/energie-ambiente-oggi-n-16-novembre-2014

This allows the Creation of an endless and multilingual Archive

of Editorial Plansfor every Magazine

its monthly issue/numberand its specific content types (title, section description)

for every year

Page 12: Pres why entity_forms_italo_mairo_drupal_days_milano_8_may_2014

#DrupalDaysIT

Milano - 8 Maggio @ 2014 - italomairo.com

Creation of Entity-Form for Editorial Plans SubscriptionsDrupal implementation

The Entity Form for Editorial Plans Subscriptions is created as a Field-able Drupal Entity.

The Entity Form Module makes doing all this very easy, and very similar to the creation of a Drupal Content Type.

Entity Forms Fields are just Drupal Fields.

In our case besides the usual and constant/text fields for collecting users informations (Name, Company, Email, Address, etc.) we were able to expose (and collect) specific and dynamic informations thorough entity reference fields to the Editorial Plans’ specific Content Types.

Here is the implemented Entity Form structure (local link): http://fieramilanomedianew/admin/structure/entityform_types/manage/seleziona_piano_editoriale/fields

Page 13: Pres why entity_forms_italo_mairo_drupal_days_milano_8_may_2014

#DrupalDaysIT

Milano - 8 Maggio @ 2014 - italomairo.com

In our specific case we had to expose dynamic content (specific Editorial Contents) regarding the specific chosen Year & Magazine Editorial,

in a sort of dependent Drop Down Menu Logic.

We needed to hardly ‘alter’ the Entity Form to achieve this, injecting a lot of code to implement Ajax Behaviors, in the Drupal compliant way > AJAX Forms in Drupal 7

The front end of the Entity-Form for Editorial Plans SubscriptionsOur Drupal implementation with Ajax Forms

Here is our live Entity Form result (external link): www.fieramilanomedia.it/sottoscrivi_piani_editoriali

… & Tableselect & JQuery

Page 14: Pres why entity_forms_italo_mairo_drupal_days_milano_8_may_2014

#DrupalDaysIT

Milano - 8 Maggio @ 2014 - italomairo.com

The collection & management of Editorial Plans SubscriptionsEntity Forms Subscriptions management with Views and Rules modules

• Entity Form Subscriptions are Drupal Entities (such as Nodes are) easily managed and exposed with Fields Displays Layouts (Full Content, Teaser, etc) and Drupal Views.

• Once submitted by the Form, the data keeps the relation with the Entities (Editorial Plans Content Types) referenced in the form, so that we are able to extend of Editorial Plans Content Types’s Views with the related Subscriptions collected by the Entity Form(this is tricky with Webform Subscriptions > needs: webform_mysql_views module)

• Besides thatthe Entity Form and each Entity Form Subscription are exposed to the Rules Module (through its Entityforms Notifications module, based on the Entity Rules one), so that “events” might be triggered over Entity Forms Submissions and their data.

• We took great advantage of all this in the Fiera Milano Media Editorial Plans Management System

… in this way > (local link)

Page 15: Pres why entity_forms_italo_mairo_drupal_days_milano_8_may_2014

Milano - 8 Maggio @ 2014 - italomairo.com

ITALO MAIROEngineer & Drupal Delevoper

Personal Web Site: www.italomairo.com

Email: [email protected]

Username on drupal.org: itamair

LinkedIn: http://it.linkedin.com/in/italomairo/

dealing with Digital Communication, Web 2.0 & Web Gis 2.0 Opensource Applications

Thank you …

Page 16: Pres why entity_forms_italo_mairo_drupal_days_milano_8_may_2014

SPONSOR

MEDIA PARTNER