I would like to display content that is not shown on the home page, but is shown on all other pages. Is there a solution how to insert this in a theme template part?
Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
Content & Markdown
You can create in your theme an .html.twig template exclusively for the home page and another template for a standard page. This way you will control what you want to be shown and what not.
Does this help you?
last edited 09/02/22
Hi.
You can use a block to display this content in which it is displayed if the page is different from the home page. For example:
TWIG
{% if not page.home() %}
{% block specific_content %}
{% endblock %}
{% endif %}
On all other pages you just have to wrap the content you want to display inside this block.
Example with page1.htm.twig:
TWIG
{% block specific_content %}
Your content here
{% endblock %}
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 6 | 94 | 8 months ago | ||
| 10 | 184 | 1 year ago | ||
| 4 | 146 | 1 year ago | ||
| 3 | 60 | 1 year ago | ||
| 4 | 254 | 1 year ago |