bootstrap cards options

Would be nice to add an option to use content instead of specific fields for the card body or option for no field at alll. Sometimes you want to use a field for title and some field for image but don't want to add a field for content. Even someone will only want to add a image. So, would be nice to not need to add the three.

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

koffer created an issue. See original summary.

koffer’s picture

Title: about option in cards » about options in cards
devkinetic’s picture

This is a great feature request. I've implemented essentially the same type of logic for a paragraph type.

Just a note, you can do basically the same thing as this using grid and a view mode that renders it's output as a card.

shelane’s picture

Version: 8.x-4.x-dev » 5.4.x-dev
Issue summary: View changes
j_s’s picture

It'd be great to remove the 'required' status on 'content' and 'image' fields. I have content that have no images that need to be displayed in a card deck.

It would also be nice to include a "Number of cards per views card deck" option so that I can have many records in a card format split into multiple card decks instead of it displaying all of the cards in one wide card deck.

ravi kant’s picture

We really need options to add bootstrap classes like - col-lg-4 and flex-wrap etc..

tirupati_singh’s picture

Assigned: Unassigned » tirupati_singh
tirupati_singh’s picture

Version: 5.4.x-dev » 5.5.x-dev

Since the fields to add classes to card group and card along with the field to choose number of cards in a row has already been implemented in 5.5.x version for the module hence, I'm changing the version for the issue to 5.5.x-dev.

tirupati_singh’s picture

Assigned: tirupati_singh » Unassigned
Status: Active » Needs review
StatusFileSize
new150.22 KB
new140.88 KB
new50.22 KB
new134.09 KB
new380.46 KB
new126.39 KB
new405.18 KB

Hi, I've added a new list value 'None' in the select list for Cards component. Now users will have the option to use Image or Content field based on their requirements. I've attached the before and after fixes screenshots for reference. However user will have design the cards as per their requirement because Cards have no fixed width to start, so they’ll naturally fill the full width of its parent element. There is a style option to add custom classes to the wrapper div and cards so that you can add additional styling to suit your needs.

Thanks!

shelane’s picture

Version: 5.5.x-dev » 5.4.x-dev
Status: Needs review » Needs work

The 5.3.x, 5.4.x, and 5.5.x branches support different versions of Bootstrap. This issue was rightly assigned to the 5.4.x branch because there is no content option in that version. The changes proposed may be valid for 5.5.x and additionally 5.4.x, but a separate issue should be made for it so that work for the 5.4.x branch can continue to be tracked.

tirupati_singh’s picture

Assigned: Unassigned » tirupati_singh

tirupati_singh changed the visibility of the branch 3112860-about-options-in to hidden.

tirupati_singh’s picture

Hi @shelane, I've added a new option 'None' in the select list value for the image and content fields. I've only implemented the feature request mentioned in the issue summary. Will the issue mentioned by @joshuasosa in the comment #5 also be implemented as the option to add number of cards, classes have already been implemented in 5.5.x version of the module? Will the same feature need to be implemented in 5.4.x version of the module? I've attached the before and after screenshots for reference. Please review the changes.

shelane’s picture

Status: Needs review » Needs work
tirupati_singh’s picture

Assigned: Unassigned » tirupati_singh
tirupati_singh’s picture

Assigned: tirupati_singh » Unassigned
StatusFileSize
new107.15 KB

Hi @shelane, I've reviewed the latest changes and a new field has been provided in the view for the cards component. While choosing the Select by fields under Display configuration all the fields become required, and on selecting the None getting error "Please select an item in the list. This issue is due to the field marked as required. Due to this issue, it is not possible to leave any field empty the user will have to render all the card components like body, title and image. I think when the None option is being provided then fields should not be marked as required.

tirupati_singh’s picture

Hi @shelane, could you please provide an update on the draft merge request MR !31 and let me know if there’s anything needed to move it forward?