[beta2] Fix card template

Created on 9 March 2023, almost 2 years ago
Updated 1 April 2023, over 1 year ago

Problem/Motivation

I noticed a strange behaviour while site building some view modes with ward component.

For example the field description is showing up above all other fields instead of being displayed under the field title.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡«πŸ‡·France G4MBINI BΓ¨gles

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

Comments & Activities

  • Issue created by @G4MBINI
  • πŸ‡«πŸ‡·France G4MBINI BΓ¨gles
  • Assigned to pdureau
  • πŸ‡«πŸ‡·France pdureau Paris

    Indeed, in Layout Builder, the order of regions (fields) in the layout is:

    1. image
    2. image_badges
    3. description
    4. tag_badges
    5. detail
    6. title
    7. detail_end
    8. footer

    Instead of:

    1. image
    2. image_badges
    3. title
    4. tag_badges
    5. detail
    6. detail_end
    7. description
    8. footer

    It may come form those CSS rules in upstream CSS:

    .fr-card__title {
      order: 2;
    }
    .fr-card__desc {
      order: 3;
    }
    .fr-card__end {
      order: 4;
    }
    fr-card__footer {
      order: 2;
    }
    ..
    

    Let's try to override them in overrides.css

  • Assigned to G4MBINI
  • Status changed to Postponed: needs info almost 2 years ago
  • πŸ‡«πŸ‡·France pdureau Paris

    Hi G4MBINI,

    It is a bit more complicated than expected :)

    They are 3 different orders of slot in cards.

    The one from the template:

    • title
    • description
    • tag_badges
    • detail
    • detail_end
    • footer
    • image
    • image_badges

    The one visible in the previews, which is different because of the "order" CSS property:

    1. image
    2. image_badges
    3. title
    4. tag_badges
    5. detail
    6. detail_end
    7. description
    8. footer

    The one currently in layout builder, which is a mess because of the "order" properties which are also counting the "add blocks" elements:

    1. image
    2. image_badges
    3. description
    4. tag_badges
    5. detail
    6. title
    7. detail_end
    8. footer

    The fix I have will not restore the preview order, but the template one. Are you OK with that?

  • Assigned to pdureau
  • Status changed to Active almost 2 years ago
  • πŸ‡«πŸ‡·France G4MBINI BΓ¨gles

    Ok ! If the result is good that's fine for me :)

  • Assigned to G4MBINI
  • Status changed to Fixed over 1 year ago
  • πŸ‡«πŸ‡·France pdureau Paris
  • Status changed to Fixed over 1 year ago
  • πŸ‡«πŸ‡·France pdureau Paris
Production build 0.71.5 2024