1 User Friendly Entity Reference Select Lists Using Views, Views Entity View Widget, and References Dialog
2 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 YearsFind me and my work at (available for freelance)
3 Situation (3 assumptions) User has to create a node (Concert) that references another node (Performers)Referenced node type (Performers) has a lot of nodes (i.e. options)We want to provide the user with an user- friendly way to find/select referenced nodes
4 Preview SitePerformer Content Type title body musical genre (taxonomy)Concert Content Type title body performers (entity reference)
5 Our Options (modules) Views (Entity Reference View Display) Entity Reference View WidgetReference DialogOthers not covered… Multiple Selects, Chosen, Dynamic Multiselect, etc.Each one has positives and negatives!
6 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 options ex.) <option>Performer – genre</option>Pass arguments from node to view (not covered)NegativesCannot group content (i.e. by genre)Cannot use exposed filters
7 How ToCreate an “Entity Reference” view displayFilter, sort, etc. view as normalSelect view in Entity Reference Field settingsPass in additional arguments
9 Option 2: Ent. Ref. View Widget PositivesAlso great for filtering and adding content to select optionsAble to Group nodesGreat for e-CommerceNegativesHard to style – the view renders the node, the rendered node is controlled via the display manager (to customize display use .tpl or similar)
10 How ToConfigure “Ent. Ref. View Widget” view mode (i.e. full, teaser, etc.) via display managerCreate an “Ent. Ref. View Widget” view displayFilter, sort, etc. view as normalSelect view in Entity Reference Field settings (this will override settings below)
12 Option 3: Reference Dialog PositivesAllows for inline entity creation combined with automatic entity reference (not possible using IEF)Allows for inline entity editingSearch Dialog page (created using views) can be formatted, filtered, and groupedNegativesModule is a bit buggy (still in alpha)Requires lots of styling to make Search Dialog page effective
13 How ToSet entity reference field to Autocomplete widgetSelect which “dialogs” to add to field (Edit, Add, and/or Search)If “Search Dialog” enabled, you must create a “Reference dialog Search” view displayAssociate the view to entity reference fieldFilter, sort, etc. view as normal
Your consent to our cookies if you continue to use this website.