Problem/Motivation

The 'visual inline mode' when comparing two revisions of a node displays the default template instead of the full template.

e.g. node--default.html.twig instead of node--full.html.twig

The default view mode in Drupal is "full" even if full is not enabled.
See https://www.drupal.org/project/drupal/issues/2844203 for the Default/Full view modes issue.

Proposed resolution

The getViewModeOptionsByBundle() and related methods returns the wrong data.
As a workaround for D8, is to allow choosing the view modes.

Issue fork diff-3058111

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Kirst25 created an issue. See original summary.

kirst25’s picture

StatusFileSize
new1.18 KB
kirst25’s picture

Assigned: kirst25 » Unassigned
rishvi’s picture

We also faced the inconvenience of not being able to set the default view mode on visual inline mode. It's not very clear to the site builders to choose a different view mode to be able to see the differences between revisions.

I would like to suggest a different approach to resolve this. Instead of replacing the default value with full, add a new config setting on visual inline to set the default view mode. Users can choose to set default or full as the default view mode on the visual inline layout.

rishvi’s picture

Status: Active » Needs review
jibran’s picture

Title: 'Visual inline' displays the 'Default' view mode instead of 'Full' » Allow user to choose 'Visual inline' display view mode
Issue summary: View changes
StatusFileSize
new34.97 KB

Sounds like a great idea to me.

+++ b/src/Form/GeneralSettingsForm.php
@@ -182,6 +182,17 @@ class GeneralSettingsForm extends ConfigFormBase {
+        '#options' => [
+          'default' => $this->t('Default'),
+          'full' => $this->t('Full content'),
+        ],

Should we add the 'diff' view mode as well?

rishvi’s picture

@jibran Thanks for your response. I will upload a new patch with diff.

Thanks!

rishvi’s picture

Here's a new patch with diff view mode. Code is also updated to handle the case where a default view mode is not enabled on a bundle type.

rishvi’s picture

StatusFileSize
new3.69 KB
rishvi’s picture

StatusFileSize
new3.69 KB
rishvi’s picture

anas_maw’s picture

Patch in 10 works for me, thanks

bkosborne’s picture

+1 this is exactly what I'm looking for. But also the ability to completely hide this view mode selector as well.

idebr’s picture

Category: Bug report » Feature request
Status: Needs review » Reviewed & tested by the community

Patch works as expected, thanks!

acbramley’s picture

Patch in #10 still applies to latest dev, I've triggered tests on D9.5 and D10. It would be great to finally get this committed!

  • acbramley committed cb0382e3 on 8.x-1.x
    Issue #3058111 by rishvi, acbramley, jibran: Allow user to choose '...
acbramley’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.