0

I am struggling to find a way for a custom block type of mine to reference a view. Basically I want a field of the block to show some of the newest articles.

Using the entity reference field and an entity reference view I must select the articles to show manually.

Is there a simple way to use the entity reference field to render the contents of a view or a view block? Or do I need to code it myself? Thanks in advance.

2
  • Why don't you use a views block directly? Core has no formatter to display a referenced view like a view, but I'm not sure why you need that indirection in the fist place, given that this is a view which can create blocks out of the box.
    – Berdir
    Feb 1, 2015 at 15:00
  • Basically I have a page which consists of blocks only, let us call it sections. So each section has different fields, some of them need to show a list of newest nodes of a specific node type.
    – alexej_d
    Feb 1, 2015 at 18:12

1 Answer 1

0

You can use https://www.drupal.org/project/viewfield to reference views and even pass arguments.

3
  • This is a D8 question, that module has no D8 release. But yes, it will need a module like that.
    – Berdir
    Feb 1, 2015 at 20:34
  • Ah sorry, missed the D8 tag. Feb 1, 2015 at 20:35
  • The sandbox of the Viewfield D8 version is here: drupal.org/sandbox/pferlito/2409263. But against D8rc3 it's broken ... Nov 5, 2015 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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