Problem:
- Views has contextual links that appear when a View is rendered as a page, and those contextual links appear to the right of the page title (the <h1> element), but the code Views uses to achieve this is ugly: see views_page_alter(), views_preprocess_html(), and views_contextual_links_view_alter().
- As of #1874664: Introduce toolbar level "Edit" mode that shows all contextual links, contextual links for nodes now appear on the node page itself, but they are attached to the node's <article> tag, which does not include the page title.

Questions:

  1. Do we want to continue the pattern of contextual links used for main page content? Much of #1874664: Introduce toolbar level "Edit" mode that shows all contextual links was about answering yes to that question, but that was not the original intent of contextual.module for D7.
  2. If we do, do we want the contextual-region including the <h1> tag, as in how views pages currently works, or not, as in how node pages currently work?
  3. Most page.tpl.php implementations currently print $tabs in between the page title and the main content. Is there a legitimate use case for tabs and main content contextual links both appearing, or should they always be mutually exclusive?
  4. If we do want to encompass the page title, how do we need to change our page.tpl.php rendering pipeline to support that cleanly, so we can remove the current Views hacks?

Comments

Wim Leers’s picture

I can offer another angle…

The real problem here is Drupal's "page title" concept.

If a node is rendered in the teaser view mode, then the node title is inside the <article class="node"> tag, i.e. all of the node's fields are properly contained. The "page title" is something else than the node title.

But, if a node is rendered in the full view mode, then the node title is outside the <article class="node"> tag, i.e. not all of the node's fields are properly contained. The "page title" is the node title.

The latter caused a lot of hackery to make in-place editing work for node titles, because the semantic structure is no longer accurate.

Gábor Hojtsy’s picture

I think there is very well a use case for contextual links and tabs appearing. For example, Views is regularly used to create different pages using tabs between them as navigation. The tabs are not actions on the views, but rather each tab is a view or a different display of a view. So the contextual link actions are on the View but the tabs are unrelated to the view's backend tasks.

Experimenting with adding contextual links to taxonomy term pages in #1915730: Decide what to do about important contextual links when that module is disabled or restricted also showed that if all of the content of the object is a title (ie. no description on the term), then there is nothing to display below the title before the list of nodes is displayed, so if contextual links are used in place of tabs, then there is no place to display them. If you enter a description, it will naturally provide space for the contextual links (like the node body or any other first field or authoring information on the node).

So I think there is a strong case to be made that the "main page object's" contextual links would be ideally carried over to the page title (if there is one) or the page title be made part of the main page object in containment (like Wim alluded to above).

jhedstrom’s picture

Version: 8.0.x-dev » 8.1.x-dev
Issue summary: View changes

Probably needs to wait until 8.1.

effulgentsia’s picture

Version: 8.1.x-dev » 8.0.x-dev

It's been a while since I opened this. Some of what's in the original issue summary might have already been fixed. In which case, are there any problems left with what's in HEAD? Depending on the answer, some might still be solvable without disrupting APIs, or we can close this issue entirely, so moving back to 8.0.x until that's answered.

Wim Leers’s picture

Changes since February 2013

It's actually in exactly the same state as it was before; none of this architecture has changed, so the same problems exist.

BUT:

  1. looking at the IS and #1, apparently the page title was considered the biggest problem. That one has been fixed relatively elegantly in #2216437: Entity labels are not in-place editable on "full entity page" (prime example: node title). $page['#title'] (where $page is the render array returned by the main content controller) is now allowed to be HTML. So this part from the IS is not actually a problem anymore: contextual links for nodes now appear on the node page itself, but they are attached to the node's tag, which does not include the page title.
  2. the more general question is: how should the main content add a contextual link? I think it's okay to expect main content controllers to return a render array with a #contextual_links property set. That works just fine. I don't think it makes sense to abstract it away further
  3. Views is a very, very special case. It still has that hackery mentioned in the IS. It's super confusing, but it's also specific to Views. It works fine automatically for other "main content", like e.g. nodes.

The 4 questions

To answer the 4 questions in the IS:

  1. Yes, over the past 1.5 years I think no one has wanted to get rid of the ability to modify a View or a Node while looking at it.
  2. Oh, hrm, I didn't look at it from that angle. That's a great question. Still unanswered.
  3. Still unanswered.
  4. I want to think this over. Now is the right time to do so.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev
larowlan’s picture

Is item 2 less of an issue now that quickedit is out of core?

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.