2

I have created my custom entities using Entity Construction Kit module.

Is it possible to render an HTML output of entity programatically? So I could display an entity for example in block?

I have found function entity_view, but it returns only array, not whole HTML output.

For now, I am using Views to achieve this. I create a view that displays one instance, and I am using function view_embed_view to display HTML.

But is there any direct function, so I don't need to create a view?

3

If you've got it working with entity_view, you probably just need to use:

print render($entity);

where $entity is the render array returned from entity_view.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.