- Issue created by @kiran.kadam911
- Merge request !27Issue#3526024: Slots are not working for few components. โ (Merged) created by Unnamed author
- 96cbe12b committed on 1.x
Issue#3526024: Slots are not working for few components.
- 96cbe12b committed on 1.x
- Merge request !28Issue#3526024: Wrap link rendering logic inside a Twig block. โ (Merged) created by Unnamed author
-
kiran.kadam911 โ
committed 96cda39b on 1.x authored by
chetansonawane โ
Issue#3526024: Wrap link rendering logic inside a Twig block.
-
kiran.kadam911 โ
committed 96cda39b on 1.x authored by
chetansonawane โ
- Assigned to meghasharma
- ๐ฎ๐ณIndia meghasharma
I checked all the components listed in this issue to see if their slots are working. For testing, I placed each component on a page and published it to confirm the slot rendering.
Slots not working in:
Space People Card โ People with Avatar Bio
Space People Card โ People with Image Bio
Organisms โ Space Sticky Jump Link
Space CTA Banner โ Type 3 (only)
Space SliderSlots working fine in:
Molecules โ Space Pricing Card
Molecules โ Space Pricing Featured Card
Molecules โ Space Quick Link Card
Space CTA Banner โ Type 2
Molecules โ Space Featured CardI am working on fixing the slot issues in the non-working components.
Thanks! - Merge request !33Issue #3526024: Slots are not working for few components โ (Merged) created by meghasharma
-
meghasharma โ
committed 8be0c503 on 1.x
Issue #3526024: Slots are not working for few components
-
meghasharma โ
committed 8be0c503 on 1.x
- ๐ฎ๐ณIndia meghasharma
I checked all the components one by one in the XB editor to identify slot issues.
Apart from the components already mentioned in this issue, I found that slots are also not working for the following components:- Space Accordion with Image โ Variation 4
- Space Avatar
- Space Avatar Group
- Space Avatar Label Group
- Space CTA Banner โ Type 1
- Space Hero Banner Style 04
- Space Hero Banner Style 05
- Space Hero Banner Style 06
- Space Hero Banner Style 07
- Space Hero Banner Style 08
- Space Hero Banner Style 09
- Space Hero Banner Style 10
- Space Hero Banner Style 11
- Space Stats KPI
- Space Text
- Space Team Section Image Card 2
- Space Team Section Image Card 3
- Space Team Section Simple 1
- Space Team Section Simple 2
- Space Team Section Simple 3
- Space Text and Media โ With Checklist
- Space Video Card
- ๐ฎ๐ณIndia meghasharma
I have fixed the slot issues for the mentioned components. Changes have been pushed in the MR. Attaching screenshots
Components fixed:
- Space People Card โ People with Avatar Bio
- Space People Card โ People with Image Bio
- Space CTA Banner โ Type 3
- Space Avatar
- Space Avatar Group
- Space Avatar Label Group
- Space CTA Banner โ Type 1
- Space Hero Banner Style 04
- Space Hero Banner Style 05
- Space Hero Banner Style 06
- Space Hero Banner Style 07
- Space Hero Banner Style 08
- Space Hero Banner Style 09
- Space Hero Banner Style 10
- Space Hero Banner Style 11
- Space Stats KPI
- Space Text
- Space Team Section Image Card 2
- Space Team Section Image Card 3
- Space Team Section Simple 1
- Space Team Section Simple 2
- Space Team Section Simple 3
- Space Text and Media โ With Checklist
- Space Video Card
Not fixed, 3 components are still not working with slots:
- Organisms โ Space Sticky Jump Link
- Space Slider
- Space Accordion with Image โ Variation 4
Thanks!
- ๐ฎ๐ณIndia meghasharma
I have fixed the slot issues for the mentioned components. Changes have been pushed in the MR. Attaching screenshots
Components fixed:
- Space People Card โ People with Avatar Bio
- Space People Card โ People with Image Bio
- Space CTA Banner โ Type 3
- Space Avatar
- Space Avatar Group
- Space Avatar Label Group
- Space CTA Banner โ Type 1
- Space Hero Banner Style 04
- Space Hero Banner Style 05
- Space Hero Banner Style 06
- Space Hero Banner Style 07
- Space Hero Banner Style 08
- Space Hero Banner Style 09
- Space Hero Banner Style 10
- Space Hero Banner Style 11
- Space Stats KPI
- Space Text
- Space Team Section Image Card 2
- Space Team Section Image Card 3
- Space Team Section Simple 1
- Space Team Section Simple 2
- Space Team Section Simple 3
- Space Text and Media โ With Checklist
- Space Video Card
Not fixed, 3 components are still not working with slots:
- Organisms โ Space Sticky Jump Link
- Space Slider
- Space Accordion with Image โ Variation 4
Thanks!
- ๐ฎ๐ณIndia meghasharma
I tried to fix the slot issue in these components:
Organisms โ Space Sticky Jump Link
Space Slider
Space Accordion with Image โ Variation 4My approach was to render slots inside a for loop. Instead of creating multiple slots (slide_1, slide_2, etc.), I defined a single slot and looped over it in Twig to wrap each item inside
- , like a typical slider.
Example:
component.yml
slots: slide_1: title: Slide description: Content for Slide examples: - 'Slide content'
component.twig<div class="splide__track"> <ul class="splide__list flex"> {% for i in range(1, number_of_slides) %} {% set slot_name = 'slide_' ~ i %} <li class="splide__slide flex-shrink-0" data-slide-number="{{ i }}"> {{ attribute(_context, slot_name)|render|default('Slide ' ~ i) }} </li> {% endfor %} </ul> </div>
However, in the XB editor the slots donโt appear. This seems related to a known XB issue: https://www.drupal.org/project/experience_builder/issues/3514923 ๐ Iterating a slot and wrapping components in markup causes front-end error Active
Thatโs likely why the for loop approach isnโt working here.
- , like a typical slider.
- Merge request !35Issue #3526024: Fixed slots and styling issues in few components. โ (Merged) created by meghasharma
- ๐ฎ๐ณIndia meghasharma
I re-checked all components one by one for slots and styling, and found issues in 4 more components, which I have fixed. The changes are pushed, and the MR is raised.
Space Video Card
Space Image Card
Space Icon Card
Space Notification Card
-
meghasharma โ
committed aee73ba8 on 1.x
Issue #3526024: Fixed slots and styling issues in few components.
-
meghasharma โ
committed aee73ba8 on 1.x
- Merge request !36Issue #3526024: Hidden for-loop slot-based components due to XB issue. โ (Merged) created by meghasharma
- ๐ฎ๐ณIndia meghasharma
Most slot issues are fixed here.
However, 3 components (Space Sticky Jump Link, Space Slider, Space Accordion with Image โ Variation 4) are still affected by the for-loop slot problem in XB.Created a new issue to track them separately: https://www.drupal.org/project/space_ds/issues/3544788 ๐ For-loop slots are not working for few components Active
Thanks!
-
meghasharma โ
committed 2d204c57 on 1.x
Issue #3526024: Hidden for-loop slot-based components due to XB issue.
-
meghasharma โ
committed 2d204c57 on 1.x