Disable view title in landing page's section views content doesn't work

Summary

When loading a view inside a Landing Page’s Section paragraph MAIN COLUMN VIEWS view reference field, there is an OPTIONS dropdown which offers the checkbox ‘Include View Title’.

This checkbox doesn’t do anything. The view’s display title will always show.

The workaround is to disable the title on the view itself, but this is just not possible sometimes when the title is needed, say in a view generating a page.

Another workaround is to hard-code some very specific and convoluted CSS on a custom theme. But this has to be addressed on the CERN components themselves first.

Steps to reproduce

  1. Create a view with a block or page display, and give that display a title.
  2. Create a landing page, add a Section paragraph, and go to the content tab and on the MAIN COLUMN VIEWS search for your newly created view on the autocomplete box
  3. Open the OPTIONS dropdown and uncheck the box for ‘Include View Title’ (image #1)
  4. Save the landing page
  5. Open the landing page and observe the view’s title showing up (image #2)

Possible fixes

Not sure how the templates that generate these landing pages are implemented, but an easy fix would be the template injecting a particular class when that checkbox is selected that can be used to at least hide the view’s title with good old CSS’s display: none.

Attachments

Hello Oscar,

I think this is caused from Views Reference Field module we use to reference views. Which version of the module do you have?

According to the issue, this is included in version 2.0 of the module but its still in beta version…

Konstantinos

1 Like

Hi @kplatis,

Thanks for the quick answer! Yes, I have an older version, specifically the 8.x-1.4 version.

I will try to install locally the 2.x-dev version and see if that solves the issue :+1:

Regards,
Óscar

Hi @kplatis,

Unfortunately installing 2.x-dev crashed the site:

The website encountered an unexpected error. Please try again later.

Drupal\Component\Plugin\Exception\PluginNotFoundException: Unable to determine class for field type 'viewsreference' found in the 'field.storage.paragraph.field_p_row_left_column_views' configuration in Drupal\field\FieldStorageConfigStorage->mapFromStorageRecords() (line 174 of core/modules/field/src/FieldStorageConfigStorage.php).

I will see if I can make it work but it looks like the versions 1 and 2 are incompatible :confused:

I will come back with more info if I advance on it, otherwise I give up, I will put some CSS makeup LOL.

Regards,
Óscar

I tried updating the module from the Updates admin page, which was telling me there was an update to 2.x-dev+alpha7. Then, on the database update I got this error message:

viewsreference module
Update #8103
Failed: 
  Drupal\Core\Database\DatabaseExceptionWrapper: 
  SQLSTATE[42S02]: Base table or view not found: 1146 
    Table 'ds990925.paragraph_revision__field_p_row_right_column_views' doesn't exist: 
      SELECT paragraph_revision__field_p_row_right_column_views.* 
      FROM {paragraph_revision__field_p_row_right_column_views} 
      paragraph_revision__field_p_row_right_column_views; 
Array ( ) in viewsreference_update_8103() (line 52 of /drupal/sites/test-kt-d8.web.cern.ch/modules/viewsreference/viewsreference.install).

I guess it has to be installed from the beginning, before the CERN Components, or maybe updated without a local version. I will try the latter and update this.

I am afraid we cannot upgrade to 2.x-dev on a live site. It would have to be installed before the CERN Components module and given a try. I will use CSS for the time being :man_shrugging:t2:

Hello Oscar,

Since it is still under development there might be a case that they havent finalized their database updates so I dont think you should depend on that

1 Like