I suspect I may just have a simple misunderstanding of how a home page is generated, but...

In a Drupal 8.7.5 website, I have a node (basic page) that I've added a paragraph entity reference field to. in the node.html.twig, I added the field, like so:

{% if content.field_content_section %}
    {{ content.field_content_section }}
{% endif %}

When I view the node, at website.com/node/1234, everything shows fine.

This page is also set to be my home page. If I go to website.com, the field_content_section does not appear.

I don't have any custom templates for the home page. html.html.twig just has {{ page }}

page.html.twig just has {{ page.content }}

I'm sure there's just some simple detail I'm missing or not understanding about how to get that entity reference field to appear on the home page (without using views to do it)

I suspected this may have something to do with an site glitch regarding language. It's something I need to resolve but can't yet. It prevents me from making paragraphs translatable... except, as I said, if I go to the node, I can see the content. It's specifically home page that doesn't work.

Hopefully that's enough information.

  • 1
    When you set a node as front page in the site settings this is like an alias / pointing to the node, so for the rendering of the node template it makes no difference. However, the condition whether you display the frontpage is used in several places within Drupal. It's hard to tell what you might have installed and configured which depends on this condition. Did you try to render the entire {{ content }}? Which by the way is the recommend way to do anyway. – 4k4 Aug 22 '19 at 19:23
  • ahh... ok. I was just looking in the wrong place for solutions. You're right.. It took two steps. one - make sure the page is set to 'promote to front page' and I also needed to look at display options. I didn't realize the home page was showing a teaser version that didn't have my field included. Thank you for sending me down the right road. – turpentyne Aug 22 '19 at 20:54
  • This is the Frontpage view. I've assumed you had set the node as default front page at /admin/config/system/site-information – 4k4 Aug 22 '19 at 21:04
  • @NoSssweat I'm not. That's a typo. I'm using 8.7.5 – turpentyne Aug 23 '19 at 3:46

Your Answer

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

Browse other questions tagged or ask your own question.