You are here

README.txt in Entity Embed 7.3

Same filename and directory in other branches
  1. 7 README.txt
  2. 7.2 README.txt
CONTENTS OF THIS FILE
---------------------

 * Introduction
 * Requirements
 * Installation
 * Usage

INTRODUCTION
------------

Current Maintainers:

 * Devin Carlson <http://drupal.org/user/290182>

Entity Embed allows any entity to be embedded using a text editor.

REQUIREMENTS
------------

Entity Embed requires Drupal 7.37 or later. It has six dependencies.

Drupal core modules
 * Filter

Contributed modules
 * Chaos Tools
 * Editor CKEditor
 * Dialog
 * Entity
 * Entity Reference
 * jQuery Update - Configured to use jQuery 1.7 or higher.

INSTALLATION
------------

* Install Entity Embed via the standard Drupal installation process:
  'http://drupal.org/node/895232'.
* Configure the jQuery Update module to use jQuery 1.7 or higher:
  '/admin/config/development/jquery_update'.
* Enable the entity-embed filter 'Display embedded entities' for the desired
  text formats from the Text Formats configuration page:
  '/admin/config/content/formats'.
* If the 'Limit allowed HTML tags' filter is enabled, add
  '<drupal-entity data-entity-type data-entity-uuid data-entity-id data-view-mode data-entity-embed-display data-entity-embed-settings>'
  to the 'Allowed HTML tags'.
* To enable the WYSIWYG plugin, move the entity-embed 'E' button into the
  Active toolbar for the desired text formats from the Text Formats
  configuration page: '/admin/config/content/formats'.

By default, Entity Embed includes a single button for embedding nodes.
Additional buttons can be added from the configuration page:
'/admin/config/content/embed-button'.

USAGE
-----

Embedding entities with WYSIWYG:

* For example, create a new *Article* content.
* Click on the 'E' button in the text editor.
* Enter part of the title of the entity you're looking for and select one of the
  search results.
* For **Display as**, choose one of the following options:
  * Rendered Entity
  * Entity ID
  * Label
* If chosen **Rendered Entity**, choose one of the following options for
  **View mode**:
  * Default
  * Full content
  * RSS
  * Search index
  * Search result highlighting input
* Optionally, choose to align left, center or right.

Embedding entities without WYSIWYG:

Users should be embedding entities using the CKEditor WYSIWYG button as
described above. This section is more technical about the HTML markup that is
used to embed the actual entity.

Embed by UUID (recommended: requires the UUID module):
<drupal-entity data-entity-type="node" data-entity-uuid="07bf3a2e-1941-4a44-9b02-2d1d7a41ec0e" data-entity-embed-display="entity_reference:entity_reference_entity_view" data-entity-embed-settings='{"view_mode":"teaser"}' />

Embed by ID (not recommended):
<drupal-entity data-entity-type="node" data-entity-id="1" data-entity-embed-display="entity_reference:entity_reference_entity_view" data-entity-embed-settings='{"view_mode":"teaser"}' />

Entity Embed Display Plugins

Embedding entities uses an Entity Embed Display plugin, provided in the
'data-entity-embed-display' attribute. By default we provide four different
Entity Embed Display plugins out of the box:

- entity_reference:_formatter_id_: Renders the entity using a specific Entity
  Reference field formatter.
- entity_reference:_entity_reference_label_: Renders the entity using the
  "Label" formatter.
- file:_formatter_id_: Renders the entity using a specific File field formatter.
  This will only work if the entity is a file entity type.
- image:_formatter_id_: Renders the entity using a specific Image field
  formatter. This will only work if the entity is a file entity type, and the
  file is an image.

Configuration for the Entity Embed Display plugin can be provided by using a
'data-entity-embed-settings' attribute, which contains a JSON-encoded array
value. Note that care must be used to use single quotes around the attribute
value since JSON-encoded arrays typically contain double quotes.

The above examples render the entity using the _entity_reference_entity_view_
formatter from the Entity Reference module, using the _teaser_ view mode.

File

README.txt
View source
  1. CONTENTS OF THIS FILE
  2. ---------------------
  3. * Introduction
  4. * Requirements
  5. * Installation
  6. * Usage
  7. INTRODUCTION
  8. ------------
  9. Current Maintainers:
  10. * Devin Carlson
  11. Entity Embed allows any entity to be embedded using a text editor.
  12. REQUIREMENTS
  13. ------------
  14. Entity Embed requires Drupal 7.37 or later. It has six dependencies.
  15. Drupal core modules
  16. * Filter
  17. Contributed modules
  18. * Chaos Tools
  19. * Editor CKEditor
  20. * Dialog
  21. * Entity
  22. * Entity Reference
  23. * jQuery Update - Configured to use jQuery 1.7 or higher.
  24. INSTALLATION
  25. ------------
  26. * Install Entity Embed via the standard Drupal installation process:
  27. 'http://drupal.org/node/895232'.
  28. * Configure the jQuery Update module to use jQuery 1.7 or higher:
  29. '/admin/config/development/jquery_update'.
  30. * Enable the entity-embed filter 'Display embedded entities' for the desired
  31. text formats from the Text Formats configuration page:
  32. '/admin/config/content/formats'.
  33. * If the 'Limit allowed HTML tags' filter is enabled, add
  34. ''
  35. to the 'Allowed HTML tags'.
  36. * To enable the WYSIWYG plugin, move the entity-embed 'E' button into the
  37. Active toolbar for the desired text formats from the Text Formats
  38. configuration page: '/admin/config/content/formats'.
  39. By default, Entity Embed includes a single button for embedding nodes.
  40. Additional buttons can be added from the configuration page:
  41. '/admin/config/content/embed-button'.
  42. USAGE
  43. -----
  44. Embedding entities with WYSIWYG:
  45. * For example, create a new *Article* content.
  46. * Click on the 'E' button in the text editor.
  47. * Enter part of the title of the entity you're looking for and select one of the
  48. search results.
  49. * For **Display as**, choose one of the following options:
  50. * Rendered Entity
  51. * Entity ID
  52. * Label
  53. * If chosen **Rendered Entity**, choose one of the following options for
  54. **View mode**:
  55. * Default
  56. * Full content
  57. * RSS
  58. * Search index
  59. * Search result highlighting input
  60. * Optionally, choose to align left, center or right.
  61. Embedding entities without WYSIWYG:
  62. Users should be embedding entities using the CKEditor WYSIWYG button as
  63. described above. This section is more technical about the HTML markup that is
  64. used to embed the actual entity.
  65. Embed by UUID (recommended: requires the UUID module):
  66. Embed by ID (not recommended):
  67. Entity Embed Display Plugins
  68. Embedding entities uses an Entity Embed Display plugin, provided in the
  69. 'data-entity-embed-display' attribute. By default we provide four different
  70. Entity Embed Display plugins out of the box:
  71. - entity_reference:_formatter_id_: Renders the entity using a specific Entity
  72. Reference field formatter.
  73. - entity_reference:_entity_reference_label_: Renders the entity using the
  74. "Label" formatter.
  75. - file:_formatter_id_: Renders the entity using a specific File field formatter.
  76. This will only work if the entity is a file entity type.
  77. - image:_formatter_id_: Renders the entity using a specific Image field
  78. formatter. This will only work if the entity is a file entity type, and the
  79. file is an image.
  80. Configuration for the Entity Embed Display plugin can be provided by using a
  81. 'data-entity-embed-settings' attribute, which contains a JSON-encoded array
  82. value. Note that care must be used to use single quotes around the attribute
  83. value since JSON-encoded arrays typically contain double quotes.
  84. The above examples render the entity using the _entity_reference_entity_view_
  85. formatter from the Entity Reference module, using the _teaser_ view mode.