Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need help rendering a message via view mode #211

Open
meecect opened this issue Feb 15, 2018 · 2 comments
Open

Need help rendering a message via view mode #211

meecect opened this issue Feb 15, 2018 · 2 comments

Comments

@meecect
Copy link

meecect commented Feb 15, 2018

I noticed that in views, only 'partials' render in the 'message text' field, and if I try to add a field for 'rendered entity' and select a view mode, nothing is rendered (in views anyway). I am running 8.x-1.x-dev from d.o.

I am adding a entity to a field via code, something like this:
$message = Message::create(['template' => 'new_concept', 'uid' => $node->get('uid')]); $message->set('field_node_reference', $node); $message->set('field_published', $node->isPublished()); $message->save();
Looking at the DB, it appears the node is added as a reference, but I can't seem to get any of it to render via a view mode. Also, even if I only have partials set to display in the view mode, rendering the message entity doesn't output them.

thanks,

@meecect
Copy link
Author

meecect commented Feb 15, 2018

Also, when using message_notify, I get the partials that are selected on the message_notify view modes for subject and body, but adding node reference or user references fields to the display mode doesn't do anything. Only partials render.

@meecect
Copy link
Author

meecect commented Feb 16, 2018

hmm, i don't seem to be having the same issue with node references, just user references when it comes to message_notify display modes, so I'm not sure if it is entity type specific or a permissions issue or what.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants