How to Configure Multiple Fields as the Button or Front Card in Views Display

Created on 3 September 2024, 2 months ago
Updated 18 September 2024, about 2 months ago

Problem/Motivation

hi
Many thanks for your the Views Vanilla JavaScript Suite modules that has save my life in many situation

however i would like to request for the possibility to excluding some fields from being automatically hidden and let them display by default.
This may be useful in a case of building a Members list card where we may want at least having the member's picture and Name display by default and remaining info available through the Reveal feature.

Possible workarounds (not simple IMHO) i found was:

#1
in the views when adding field, choose Rendered entity and move it as first field (the supposed that you have created a custom view mode for that entity that you will choose when configuring this added field)

#2
Use the https://www.drupal.org/project/views_field_view β†’ module to embed per row a configured view that will be use as the first field

Thanks

✨ Feature request
Status

Fixed

Version

1.0

Component

Miscellaneous

Created by

πŸ‡§πŸ‡―Benin delacosta456

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

Comments & Activities

  • Issue created by @delacosta456
  • Assigned to flashwebcenter
  • Status changed to Fixed 2 months ago
  • πŸ‡ΊπŸ‡ΈUnited States flashwebcenter Austin TX

    Hello,
    Thank you so much! I'm glad to hear that the Views Vanilla JavaScript Suite modules have been helpful for you.

    You can accomplish this task using just Views, without needing any additional modules. The instructions below have been updated on the module's home page for your convenience.

    How to Configure Multiple Fields as the Button or Front Card in Views Display

    My contrib modules for Drupal Views Plugin Display, such as Accordion, Tabs, Reveal, and 3D Cards, allow for dynamic content display based on the first field in your view. By default, the first field selected in the view configuration is used as the button or front card. However, if you wish to utilize more than one field as the "first field" for the button or front card, follow these steps:

    Step-by-Step Instructions:

    1. Add Desired Fields: In your Views configuration, add all the fields you want to use as the button or front card.
    2. Exclude from Display: For each of these fields, mark them as "Exclude from display". This ensures that these fields are available for use but are not directly shown in the final output.
    3. Create a Custom Global Field:
      • Add a Custom Global Field (Text) to your view.
      • Use the Replacement Patterns feature to insert tokens for the fields you've excluded from the display. This allows you to combine multiple fields into one single output.

    Field Ordering Guidance:

    • Arrange the fields in your view so that the hidden fields (the ones excluded from display) come first.
    • Follow the hidden fields with the custom global field that will act as the button or front card.
    • After these fields, add any remaining fields that will make up the rest of your content.

    By following these steps and arranging your fields in this order, you can use multiple fields as the first field for your button or front card, offering greater flexibility and customization in your Drupal Views displays.

    **Note: I have updated the live demo with these settings for all cards. Additionally, I created a view β†’ that you can import and use as an example.


    When you click on Custom Text Global Field:

    Best wishes,
    Alaa

  • πŸ‡§πŸ‡―Benin delacosta456

    hi
    ook thanks for repling. i will check that

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

Production build 0.71.5 2024