Views more link on top

Created on 26 November 2024, 4 months ago

Problem/Motivation

Views have the ability to provide a "more link".
By default, that's rendered in the bottom of the block.
Ideally, this should be at the top right corner.

Proposed resolution

Ideally, this would be a preprocess that can add a template suggestion for views blocks _only when on the dashboard_.
The template will render the more link at the top.

Remaining tasks

Investigate if that's feasible and provide a MR.

User interface changes

More link shows at the top, not the bottom, via a template, so themes could override this behavior.

API changes

Added new suggestion.

Data model changes

None.

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺

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

Comments & Activities

  • Issue created by @penyaskito
  • 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺

    I did some research on this, and didn't get to any solution in a generic way.

    From this research I created 📌 Provide a way to know the dashboard context to a block even if not context aware Active .

    This way a hook_preprocess_block can be aware and provide suggestions. We could provide the suggestions ourselves, but would be for e.g. block-block, not the content inside the block, which is what we really care about.

    E.g. for a block view, we can have its own block preprocess + template, but that wouldn't override views-view.html.twig, where the link rendering resides.

    If we pass the dashboard context in some way to the view (which we can), we could do this via css. But that breaks accessibility as the visual order would differ from the markup order.

  • 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺

    Changed titles as this ideally won't only apply to views.

  • 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺
Production build 0.71.5 2024