Skip to main content
added 93 characters in body; edited tags; edited title
Source Link
Pierre.Vriens
  • 36k
  • 40
  • 50
  • 182

How to build and embed the output of a Message entity (fromcreated by the Message module)?

I need to, given the midmid (Message= Message ID), generate the Message content for a specific view mode. How can I do this?

It seems to be complicated by the fact that a Message is an entity (created by the Message module), and there are multiple Message types, each of which have their own fields and rely heavily on tokens.

I'm hoping for something simple like:

$message = message_load($mid, $view_mode);
$output = drupal_render(entity_view($message));

...but but everything I've found that loads Messages seems to rely on weird wrappers and stuff and I haven't been able to find a working solution no matter how much I tinker with it.

How to build and embed the output of a Message entity (from the Message module)?

I need to, given the mid (Message ID), generate the Message content for a specific view mode. How can I do this?

It seems to be complicated by the fact that a Message is an entity, and there are multiple Message types, each of which have their own fields and rely heavily on tokens.

I'm hoping for something simple like:

$message = message_load($mid, $view_mode);
$output = drupal_render(entity_view($message));

...but everything I've found that loads Messages seems to rely on weird wrappers and stuff and I haven't been able to find a working solution no matter how much I tinker with it.

How to build and embed the output of a Message entity created by the Message module?

I need to, given the mid (= Message ID), generate the Message content for a specific view mode. How can I do this?

It seems to be complicated by the fact that a Message is an entity (created by the Message module), and there are multiple Message types, each of which have their own fields and rely heavily on tokens.

I'm hoping for something simple like:

$message = message_load($mid, $view_mode);
$output = drupal_render(entity_view($message));

... but everything I've found that loads Messages seems to rely on weird wrappers and stuff and I haven't been able to find a working solution no matter how much I tinker with it.

Source Link

How to build and embed the output of a Message entity (from the Message module)?

I need to, given the mid (Message ID), generate the Message content for a specific view mode. How can I do this?

It seems to be complicated by the fact that a Message is an entity, and there are multiple Message types, each of which have their own fields and rely heavily on tokens.

I'm hoping for something simple like:

$message = message_load($mid, $view_mode);
$output = drupal_render(entity_view($message));

...but everything I've found that loads Messages seems to rely on weird wrappers and stuff and I haven't been able to find a working solution no matter how much I tinker with it.