Coder Social home page Coder Social logo

inline_view_modes's Introduction

Inline View Modes

Purpose

The Inline View Modes module should account for the following functionality:

When placing a normal Entity Reference or Entity Reference Revisions field on any entity (node, paragraph, taxonomy term, etc.), the content editor (with appropriate permissions) should have the ability to choose a View Mode for the referenced entity or group of entities.

When configuring the FieldFormatter for the Entity Reference [Revisions] fields via the Manage Display screen for the appropriate entity, the user should be able to set a default view mode for EACH Target Type bundle.

This above scenario is a current limitation (oversight?) in Drupal. When you currently create an Entity Reference that allows for multiple types of entity bundles to be referenced (Article, Basic Page), the View Mode settings allow you to select any view mode for ALL types of content. This includes view modes that aren't even enabled for the specific content types. So the problem exists that you could be referencing two node types that don't share any View Modes other than Default.

Field Configuration Options

Provides functionality to add ThirdPartySetting to appropriate fields for enabling or disabling Inline View Modes on an entity.

The field configuration is handled via the inline_view_modes_form_field_config_edit_form_alter() function.

The storage of the configuration is handled via inline_view_modes_add_enable_config().

Proposed Features

Enable View mode selection PER reference

Each referenced entity in a multiple value field can select a different view mode.

Status: In progress.

Enable View mode selection PER field.

Status: To be developed.

Each "group" of referenced entities in a multiple value field must use the same view mode. This should only be used on entity reference fields that filter to allow a single entity type to be referenced.

Form Display

Form display is handled through inline_view_modes_field_widget_form_alter() for per reference view modes.

Display Options

In order to allow multiple FieldTypes and FieldWidgets to use the Inline View Modes functionality, all functionality prior to the FieldFormatter is handled through appropriate alter hooks. This allows Inline View Modes functionailty on both the core Entity Reference field and Entity Reference Revisions FieldTypes as well as Inline Entity Form FieldWidgets (planned).

In order to handle the full adjustments needed to the FieldFormatter for Rendered Entity a class is provided that will be used instead.

class EntityReferenceIvmEntityFormatter extends EntityReferenceEntityFormatter

Moderation Options

Any moderation options should be handled the same as an Entity Reference field. (To investigate)

Permissions

  • administer inline view modes - Should allow a user with proper administrative permissions to create a reference field, and choose to configure it with Inline View Modes.
  • use inline view modes - Should allow a user with proper content adding/editing permissions to select a custom view modes. Otherwise, the defaults configured in the FieldFormatter would be used.

Modules to integrate

inline_view_modes's People

Contributors

himerus avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

cyberschorsch

inline_view_modes's Issues

Add option to restrict view modes

Choosing a view mode is a great feature when referencing entities. For some entity types, I don`t want certain user roles to be able to choose any view mode which is enabled for an entity type.

Proposal:

Either add a per-entitytype and per-viewmode permission so we can allow selecting view modes based on roles or add an option for view modes to exclude them from the select list.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.