Be able to print the Views title

Created on 1 June 2016, over 8 years ago
Updated 1 March 2023, almost 2 years ago

A serious deficiency in views_embed_view is that lack of a title. See https://api.drupal.org/api/drupal/core%21modules%21views%21views.module/...

Can you grab a page from views itself and use similar logic to its block plugin? So we can easily print the view title too.

✨ Feature request
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

heddn Nicaragua

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States danflanagan8 St. Louis, US

    I was just dealing with this and wanted to clarify some things.

    The drupal_block method was changed in twig_tweak 2.x such that the issue noted in #5, #6, and #7 (and maybe others) is no longer an issue. That's why the approach in #17 works these days.

    As for #18:

    but I can't put the title into the of the block.
    How can I do that ?

    You can add block settings as a second argument to drupal_block like so:

    {{ drupal_block('views_block:espace_partenaire_2022-block_1', {'label': true} ) }}
    

    We are passing {'label': true} as the settings for the block. That should show the title.

Production build 0.71.5 2024