User Friendly Entity Reference Select Lists

16
User Friendly Entity Reference Select Lists Using Views, Views Entity View Widget, and References Dialog

description

User Friendly Entity Reference Select Lists. Using Views, Views Entity View Widget, and References Dialog. Hello there!. My name is Chris Hoffman (hoff331 on Drupal.org ) Graphic Designer and Front-end Developer (yes, I know I am using PowerPoint) Working with Drupal for 3 Years - PowerPoint PPT Presentation

Transcript of User Friendly Entity Reference Select Lists

Page 1: User Friendly Entity Reference Select Lists

User Friendly Entity Reference

Select ListsUsing Views, Views Entity View Widget, and

References Dialog

Page 2: User Friendly Entity Reference Select Lists

Hello there!

My name is Chris Hoffman(hoff331 on Drupal.org)

Graphic Designer and Front-end Developer (yes, I know I am using PowerPoint)

Working with Drupal for 3 Years

Find me and my work atwww.GetJumpstartNow.com(available for freelance)

Page 3: User Friendly Entity Reference Select Lists

Situation(3 assumptions)

1. User has to create a node (Concert) that references another node (Performers)

2. Referenced node type (Performers) hasa lot of nodes (i.e. options)

3. We want to provide the user with an user-friendly way to find/select referenced nodes

Page 4: User Friendly Entity Reference Select Lists

Preview Site

Performer Content Typetitlebodymusical genre (taxonomy)

Concert Content Typetitlebodyperformers (entity reference)

Page 5: User Friendly Entity Reference Select Lists

Our Options(modules)

1. Views (Entity Reference View Display)

2. Entity Reference View Widget

3. Reference Dialog

4. Others not covered… Multiple Selects, Chosen, Dynamic Multiselect, etc.

Each one has positives and negatives!

Page 6: User Friendly Entity Reference Select Lists

Option 1: Views

Positives

Entity Reference comes with a view display

Great for filtering lists of referenced nodes(before the options before user sees them)

Great for adding node fields to select optionsex.) <option>Performer – genre</option>

Pass arguments from node to view(not covered)

Negatives

Cannot group content (i.e. by genre)

Cannot use exposed filters

Page 7: User Friendly Entity Reference Select Lists

How To

1. Create an “Entity Reference” view display

2. Filter, sort, etc. view as normal

3. Select view in Entity Reference Field settings

4. Pass in additional arguments

Page 8: User Friendly Entity Reference Select Lists

Demo Views

Page 9: User Friendly Entity Reference Select Lists

Option 2: Ent. Ref.View Widget

Positives

Also great for filtering and adding content to select options

Able to Group nodes

Great for e-Commerce

Negatives

Hard to style – the view renders the node, the rendered node is controlled via the display manager (to customize display use .tpl or similar)

Page 10: User Friendly Entity Reference Select Lists

How To

1. Configure “Ent. Ref. View Widget” view mode (i.e. full, teaser, etc.) via display manager

2. Create an “Ent. Ref. View Widget” view display

3. Filter, sort, etc. view as normal

4. Select view in Entity Reference Field settings(this will override settings below)

Page 11: User Friendly Entity Reference Select Lists

Demo Ent. Ref.Views Widget

Page 12: User Friendly Entity Reference Select Lists

Option 3:Reference Dialog

Positives

Allows for inline entity creation combined with automatic entity reference (not possible using IEF)

Allows for inline entity editing

Search Dialog page (created using views) can be formatted, filtered, and grouped

Negatives

Module is a bit buggy (still in alpha)

Requires lots of styling to make Search Dialog page effective

Page 13: User Friendly Entity Reference Select Lists

How To

1. Set entity reference field to Autocomplete widget

2. Select which “dialogs” to add to field(Edit, Add, and/or Search)

3. If “Search Dialog” enabled, you must createa “Reference dialog Search” view display

4. Associate the view to entity reference field

5. Filter, sort, etc. view as normal

Page 14: User Friendly Entity Reference Select Lists

DEMO Reference Dialog

Page 15: User Friendly Entity Reference Select Lists

Other Options

Multiple Selects

Chosen

Dynamic Multiselect

See article by Lullabot:http://www.lullabot.com/blog/articles/entityreference-multiselectors

Page 16: User Friendly Entity Reference Select Lists

Questions?