How to display unread messages in a view ?

Created on 19 November 2020, over 3 years ago
Updated 10 February 2024, 5 months ago

I created a pageview to display admin discussion threads. I want to filter this view and only show threads unread by admin.

How to display unread messages in a view ?

uuid: af3730b3-a129-4343-b65b-8413a05ec20c
langcode: fr
status: true
dependencies:
  config:
    - core.entity_view_mode.private_message_thread.dmin
  module:
    - private_message
id: admin_private_message
label: 'Admin messages'
module: views
description: 'Admin tasks'
tag: ''
base_table: private_message_threads
base_field: id
display:
  default:
    display_plugin: default
    id: default
    display_title: Master
    position: 0
    display_options:
      access:
        type: none
        options: {  }
      cache:
        type: none
        options: {  }
      query:
        type: views_query
        options:
          disable_sql_rewrite: false
          distinct: false
          replica: false
          query_comment: ''
          query_tags: {  }
      exposed_form:
        type: basic
        options:
          submit_button: Apply
          reset_button: false
          reset_button_label: Reset
          exposed_sorts_label: 'Sort by'
          expose_sort_order: true
          sort_asc_label: Asc
          sort_desc_label: Desc
      pager:
        type: some
        options:
          items_per_page: 5
          offset: 0
      style:
        type: table
        options:
          grouping: {  }
          row_class: ''
          default_row_class: true
          override: true
          sticky: false
          caption: ''
          summary: ''
          description: ''
          columns:
            last_access_time_target_id: last_access_time_target_id
            private_messages_target_id: private_messages_target_id
            updated: updated
          info:
            last_access_time_target_id:
              align: ''
              separator: ''
              empty_column: false
              responsive: ''
            private_messages_target_id:
              align: ''
              separator: ''
              empty_column: false
              responsive: ''
            updated:
              sortable: false
              default_sort_order: asc
              align: ''
              separator: ''
              empty_column: false
              responsive: ''
          default: '-1'
          empty_table: true
      row:
        type: fields
      fields:
        updated:
          id: updated
          table: private_message_threads
          field: updated
          relationship: none
          group_type: group
          admin_label: ''
          label: Le
          exclude: false
          alter:
            alter_text: false
            text: ''
            make_link: false
            path: ''
            absolute: false
            external: false
            replace_spaces: false
            path_case: none
            trim_whitespace: false
            alt: ''
            rel: ''
            link_class: ''
            prefix: ''
            suffix: ''
            target: ''
            nl2br: false
            max_length: 0
            word_boundary: true
            ellipsis: true
            more_link: false
            more_link_text: ''
            more_link_path: ''
            strip_tags: false
            trim: false
            preserve_tags: ''
            html: false
          element_type: ''
          element_class: ''
          element_label_type: ''
          element_label_class: ''
          element_label_colon: true
          element_wrapper_type: ''
          element_wrapper_class: ''
          element_default_classes: true
          empty: ''
          hide_empty: false
          empty_zero: false
          hide_alter_empty: true
          click_sort_column: value
          type: timestamp
          settings:
            date_format: short
            custom_date_format: ''
            timezone: ''
          group_column: entity_id
          group_columns: {  }
          group_rows: true
          delta_limit: 0
          delta_offset: 0
          delta_reversed: false
          delta_first_last: false
          multi_type: separator
          separator: ', '
          field_api_classes: false
          entity_type: private_message_thread
          entity_field: updated
          plugin_id: field
        rendered_entity:
          id: rendered_entity
          table: private_message_threads
          field: rendered_entity
          relationship: none
          group_type: group
          admin_label: ''
          label: Message
          exclude: false
          alter:
            alter_text: false
            text: ''
            make_link: false
            path: ''
            absolute: false
            external: false
            replace_spaces: false
            path_case: none
            trim_whitespace: false
            alt: ''
            rel: ''
            link_class: ''
            prefix: ''
            suffix: ''
            target: ''
            nl2br: false
            max_length: 0
            word_boundary: true
            ellipsis: true
            more_link: false
            more_link_text: ''
            more_link_path: ''
            strip_tags: false
            trim: false
            preserve_tags: ''
            html: false
          element_type: ''
          element_class: ''
          element_label_type: ''
          element_label_class: ''
          element_label_colon: true
          element_wrapper_type: ''
          element_wrapper_class: ''
          element_default_classes: true
          empty: ''
          hide_empty: false
          empty_zero: false
          hide_alter_empty: true
          view_mode: dmin
          entity_type: private_message_thread
          plugin_id: rendered_entity
        view_private_message_thread:
          id: view_private_message_thread
          table: private_message_threads
          field: view_private_message_thread
          relationship: none
          group_type: group
          admin_label: ''
          label: Lien
          exclude: false
          alter:
            alter_text: false
            text: ''
            make_link: false
            path: ''
            absolute: false
            external: false
            replace_spaces: false
            path_case: none
            trim_whitespace: false
            alt: ''
            rel: ''
            link_class: ''
            prefix: ''
            suffix: ''
            target: ''
            nl2br: false
            max_length: 0
            word_boundary: true
            ellipsis: true
            more_link: false
            more_link_text: ''
            more_link_path: ''
            strip_tags: false
            trim: false
            preserve_tags: ''
            html: false
          element_type: ''
          element_class: ''
          element_label_type: ''
          element_label_class: ''
          element_label_colon: true
          element_wrapper_type: ''
          element_wrapper_class: ''
          element_default_classes: true
          empty: ''
          hide_empty: false
          empty_zero: false
          hide_alter_empty: true
          text: Voir
          output_url_as_text: false
          absolute: false
          entity_type: private_message_thread
          plugin_id: entity_link
      filters: {  }
      sorts:
        updated:
          id: updated
          table: private_message_threads
          field: updated
          relationship: none
          group_type: group
          admin_label: ''
          order: ASC
          exposed: false
          expose:
            label: ''
          granularity: second
          entity_type: private_message_thread
          entity_field: updated
          plugin_id: date
      title: Messages
      header:
        area_text_custom:
          id: area_text_custom
          table: views
          field: area_text_custom
          relationship: none
          group_type: group
          admin_label: ''
          empty: true
          tokenize: false
          content: '<h2>MESSAGES</h2>'
          plugin_id: text_custom
        result:
          id: result
          table: views
          field: result
          relationship: none
          group_type: group
          admin_label: ''
          empty: true
          content: 'Résultat affiché @start à @end sur @total'
          plugin_id: result
      footer: {  }
      empty:
        area_text_custom:
          id: area_text_custom
          table: views
          field: area_text_custom
          relationship: none
          group_type: group
          admin_label: ''
          empty: true
          tokenize: false
          content: 'Aucun résultat trouvé.'
          plugin_id: text_custom
      relationships: {  }
      arguments:
        members_target_id:
          id: members_target_id
          table: private_message_thread__members
          field: members_target_id
          relationship: none
          group_type: group
          admin_label: ''
          default_action: default
          exception:
            value: all
            title_enable: false
            title: All
          title_enable: false
          title: ''
          default_argument_type: current_user
          default_argument_options: {  }
          default_argument_skip_url: false
          summary_options:
            base_path: ''
            count: true
            items_per_page: 25
            override: false
          summary:
            sort_order: asc
            number_of_records: 0
            format: default_summary
          specify_validation: false
          validate:
            type: none
            fail: 'not found'
          validate_options: {  }
          break_phrase: false
          not: false
          entity_type: private_message_thread
          entity_field: members
          plugin_id: numeric
      display_extenders: {  }
      use_ajax: true
      group_by: false
    cache_metadata:
      max-age: -1
      contexts:
        - 'languages:language_content'
        - 'languages:language_interface'
        - url
        - user
      tags:
        - 'config:core.entity_view_display.private_message_thread.private_message_thread.default'
        - 'config:core.entity_view_display.private_message_thread.private_message_thread.dmin'
        - 'config:core.entity_view_display.private_message_thread.private_message_thread.inbox'
  block_1:
    display_plugin: block
    id: block_1
    display_title: Block
    position: 1
    display_options:
      display_extenders:
        metatag_display_extender: {  }
    cache_metadata:
      max-age: -1
      contexts:
        - 'languages:language_content'
        - 'languages:language_interface'
        - url
        - user
      tags:
        - 'config:core.entity_view_display.private_message_thread.private_message_thread.default'
        - 'config:core.entity_view_display.private_message_thread.private_message_thread.dmin'
        - 'config:core.entity_view_display.private_message_thread.private_message_thread.inbox'
💬 Support request
Status

Fixed

Version

3.0

Component

User interface

Created by

🇫🇷France zenimagine

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

Merge Requests

Comments & Activities

Not all content is available!

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

Production build 0.69.0 2024