Closed (fixed)
Project:
Drupal CMS development repository
Component:
Olivero
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 Jan 2025 at 20:29 UTC
Updated:
5 Mar 2025 at 13:29 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
phenaproximaEscalating to critical because @ckrina told me it is a must-have issue for the Experience Builder preview to be viable. I am not calling it a stable blocker, though, since the XB preview is not itself a stable blocker.
Comment #3
phenaproximaComment #4
boulaffasae commentedComment #5
ckrinaFigma link added.
Comment #6
phenaproximaComment #7
ckrinaI saved without refreshing the issue and lost some data. Adding them back. @boulaffasae I can't assign the issue back to you.
Comment #8
balintbrewsComment #9
boulaffasae commentedComment #11
boulaffasae commentedThank you @ckrina for Figma links, @balintbrews for the eval command, @phenaproxima for implementing a bridge between XB and the Drupal CMS.
I was able to finalise the Front-end for the Feature component (screenshots provided in the files section).
DONE:
- Desktop
- Mobile
TODO:
- Need to add tags to props, currently they are hardcoded
- Need to figure out how to add a condition on the image (add .feature--has-no-image to the parent div when image is not provided)
Comment #12
boulaffasae commentedComment #13
thejimbirch commentedYou may be able to use :has() inside :not() instead of adding a class.
Comment #14
pdureau commentedNo slots in this component? Why the slots get so little love in the SDC community those days? 🙃
A few feedbacks.
imageprop must be a slotThe
$refof this prop:has 2 issues which can be resolved by switching to a slot:
$deffromexperience_builder.moduleper se, but in this specific case it is better to not bend the component definition to please the display builder, whatever it is.I have already warned XB team about this problematic
$ref: https://www.drupal.org/project/experience_builder/issues/3468944#comment...Today, the MR template looks like that:
But I guess it will looks like that later:
This rigid structure doesn't fit with real life usage. What will happen if some props are missing or empty? What about other classes? What about other attributes? cross origin rules? lazy loading? responsive sources?
A simple
imageslot with{{ image|add_class( "my-section__img") }}will fix all those issues.Experience Builder is an exciting but early product, with some youthful quirks. Let's not impact the
drupal_cms_oliverointegrity with them. Lets' build the best components first and wait the display builders to get better.ctaas a slot to avoid prop drillingWe have this in the definition:
And this in the template:
button--primaryis clearly its own component, distinct fromfeature, so we have those 2 issues:buttoncomponent markup is duplicated in thefeaturecomponent template, which will cause maintenance issues when the former will evolvefeaturecomponent is too busy (2 unexpected props!) because of the "prop drilling" (defining props in a component to pass them in a child component)We need a
ctaslot, where it will be possible to inject a button component (or anything else 😉).Missing
attributesobjectWe currently have this in the MR:
2 issues:
So, why not leveraging the Attribute object called
attributes, injected in all component template by SDC, instead?attributesis great because it is a standardized powerful API endpoint for all components:aria-*,role,alt...) through itlangattribute when needed|add_class()and|set_attribute()Twig filters rely on itHappy to discuss further if you find those feedbacks useful.
Comment #15
phenaproximaWith gratitude and appreciation for the feedback, I would like to point out something here:
This does not need to be perfect, or feature-complete, or even close to it. This is strictly meant for a one-off, single-page, read-only demo of Experience Builder, which is under heavy development, and we are not (for now) going to allow people to build real production pages with these components. We have a lot of leeway to change them in future releases of Drupal CMS, although we will try to maintain backwards compatibility in our Olivero subtheme.
Having said that, If changing the image to a slot is easy to do (I am not a front-end developer so I have no idea) and costs us nothing (or very little) in time and effort, great! I leave it up to @boulaffasae to decide whether or not to do that. But this needs to get done, and it needs to get done this week, so let's prioritize getting it done even if has rough edges.
Comment #16
balintbrewsI think those are excellent points about avoiding prop drilling, @pdureau. One concern I have is that XB is not yet able to limit which components can be placed inside a slot, nor can it limit how many components you can place.
Because of that, I'm leaning towards advocating for more props for the time being. The goal with these first SDCs is to give an early preview of features that work in XB. I'm worried that going too heavy on slots would do more to highlight what doesn't work yet.
Comment #17
boulaffasae commentedHi everyone,
I updated the component.yml file
** Added a new Boolean (with_image: Specifies whether to include an image. Set to true to include an image, or false to exclude it.)
** Replaced the Image prop with an Image slot
I hope this saves us time for the demo.
At the same time I would love to share some insights :
1. Slots seem to be limited to only one component, therefore I couldn't use it for Tags and I kept them hardcoded.
2. This component specifically has two variants (with/without image) to help simplify the process, I added the new Boolean (with_image). Without it we will be left with a slot space for image - or a static HTML and we can't remove it (in case it's a slot it will show the slot empty space :/)
3. slots accept only a String value in the examples entry, this prevented me from turning the CTA into a slot because they will need to drop a component there to run the demo :/ (It’s not difficult, yes, but It's not important either at least not for now)
Comment #19
pameeela commentedWow, awesome to be able to start testing this!! And thank you so much @boulaffasae for jumping in :)
After a quick test I removed the tags element altogether, the use case in general of tagging a feature card isn't super clear to me, and we have not included tags in the teaser card in any other context in Drupal CMS. So given this and the potential complexity I think it makes sense to leave it out for now.
Otherwise it works great, the image selection modal is pretty broken but will check the XB queue for that and log it there if it doesn't already exist.
I'll leave it at Needs review in case anyone else has feedback on the implementation but I'm really super excited to see this in action!!!
Comment #20
pameeela commentedAlso just tweaked some of the text and labels. It wasn't immediately obvious to me that the image was a separate component, so I used the sub-heading to explain this.
And the field descriptions aren't displaying so maybe better to remove them?
Lastly the button was called 'Optional CTA button' but if it's blank, it still outputs a button element so it isn't really optional. I don't mind this though, I updated the label anyway.
Comment #21
phenaproximaI have no objection to merging this as-is, but I'd prefer if the RTBC came from someone else.
Comment #22
phenaproximaComment #23
boulaffasae commentedHi @pameeela,
Thank you for your reviews (and your kind words).
@phenaproxima I skipped condition for displaying/hiding props :
Instead of doing
I only did
Just to keep the code aligned with every other XB component template. We will need to apply these adjustments in the near future.
Comment #24
balintbrewsWould we be able to skip the Include image prop if we used a prop for the image instead of the slot? If so, I would strongly recommend doing that.
As I said in #16, I agree with #14 as the long-term direction. However, for these first few components, we would be demonstrating a cleaner user experience with a simple image prop.
Not only would we remove the need for the Include image checkbox as a prop, but we would also make it explicit how an image can be added. Right now, users need to know to place an Image component into the slot. However, they can add other components too, as mentioned in #16.
I feel strongly that at this stage of XB, using the image as a prop would better present the capabilities than implementing it as a slot. XB needs more work on slots to use their full potential. It will be exciting to get there, but for now, my vote is for props when possible.
Comment #25
pameeela commented@balintbrews agree on using a prop for image for the sake of simplicity. This is all new to us and especially since slots can't be limited, this is sure to create more confusion. If this also negates the need for the 'Include image' option, that's great too! But won't it have a placeholder image still so would need to be explicitly disabled?
Comment #26
pdureau commentedThanks @phenaproxima for sharing with me this context.
Comment #27
boulaffasae commentedHi @balintbrews, no not really I switched to slots just to make it easier.
The Include image prop is needed to manage the Feature with no Image case.
- Props are already broken (I can neither upload an image through Media Library, nor use image is empty condition)
- Slots can not be hidden :/
Comment #28
balintbrewsThis is how I did it for the Card component:
71a0718b.Let's ignore quirks and bugs of the media library dialog in XB. We'll iron those out, but this should be okay for a preview, I think, and it shouldn't block these components.
Comment #29
vasantha deepika commentedComment #30
pameeela commentedComment #31
vasantha deepika commentedReverting the image slot back to props due to limitations with the current image implementation.
Thank you, @balintbrews, for your suggestion—it makes the process more streamlined.
Comment #32
vasantha deepika commentedI need clarification regarding the desktop design—there seems to be a variation in the padding of the card. Could someone confirm which desktop design we should proceed with?
Comment #33
vasantha deepika commentedComment #34
balintbrewsComment #35
boulaffasae commentedHi @vasantha deepika,
Content (wrap title, subtitle, and Tags) padding is 45px top/right/bottom/left, it should be centered in the middle if they image size is bigger.
If no image exist, then the padding for the Content again should be top 84, left/right 94, and bottom is 54.
And the latest example, because Image size is less than content, the image get centerd.
I hope this clarify everything for you ^^
Comment #36
vasantha deepika commented@balintbrews Thank you for your feedback; I am updating the MR accordingly.
@boulaffasae Thank you for your clarification!
Comment #37
vasantha deepika commentedI have updated MR #372 based on the feedback provided in the comments and changed its status to 'Needs Review' for further evaluation.
Comment #38
vasantha deepika commentedComment #39
mherchelThis is looking super great! Thank you @boulaffasae and @vasantha deepika.
I talked to @jwitkowski (the designer) and we need some changes:
I'm going to work on this now to get it in for 1.0
Comment #40
mherchelWorking on this.
Comment #41
mherchelStyle update pushed. Also added a 'Flipped layout" per Jen!
Comment #42
phenaproximaSending to @pameeela for review and assigning credit.
Comment #43
phenaproximaComment #44
kristen polGoing to take this for a whirl now...
Comment #45
kristen polI have some suggestions, but let me show the results of testing first.
Comment #46
kristen polNow some feedback... I understand this doesn't have to be perfect so feel free to ignore some/all of this... forgive the formatting... it's getting late here:
I'll try to make a couple of these changes that seem more important.
Comment #47
kristen polI implemented suggestions 3 & 4 from #46 as well as changed the status to "experimental" per other discussions (though maybe the status will be removed).
For more info on the attributes, see #3469525: Update SDDS SDCs attributes prop to align with XB.
Comment #48
kristen polIf anything else from #46 should change, I can make the changes myself, just let me know.
Oh... and here's how the tagline "textarea" looks:
Comment #49
kristen polForgot the mobile view...
Comment #50
mherchelYeah! Feel free to get in here and make changes. Just ping me in slack so we're not duplicating work.
Comment #51
kristen polThe one I'd like some feedback on is "tagline". Do people resonate with that name?
I was thinking "summary" would be simple and more accurate, but open to opinions.
If this changes, I'll change it here and on the hero to match.
UPDATE: I'm pinging some people in Slack and will work on some other issues in the meantime.
Comment #52
tonypaulbarkerA tagline is a marketing device for an organisation. If you have company profiles it could be a field there but not for generic content or fields.
A title and a subtitle is a content field.
A heading of various levels are HTML elements that can be applied to content.
A button is an HTML element. A link should be labelled as a link. A class of button-styled-link may be applied, but still it’s a link.
The call to action is the whole component, part of the call to action is the description of what will happen when you follow the link.
So I would use naming along these lines:
Title
Call to action text
CTA Link
CTA Link text
Comment #53
kristen polThanks @tonypaulbarker!
I'm worried that not everyone knows CTA... which is probably why it wasn't called that.
And, we are saying the links are optional, so there could be no CTA at all, so I wouldn't call the text anything to do with CTA.
Note that the description text could refer CTA, but right now the descriptions aren't on the form fields.
Given the above, I suggest we go for more generic naming, something like below, which can be used across components, so the terminology isn't changing for each one.
Comment #54
tonypaulbarkerI think that would work. Summary feels accurate.
Comment #55
kristen polCool, thanks. I'll update with that and then update the hero to match.
Comment #56
kristen polI pinged @mherchel in Slack to get sign-off on #53 before doing the naming changes as I don't want to put the effort in if he's not onboard.
Comment #57
pameeela commented@kristen pol those names sound good to me. I originally changed it from 'CTA' to 'Button' but I didn't spend much time on that, just had a feeling that CTA was not super obvious. Link is also good!
Comment #58
kristen polSweet! Thanks! I'm unblocked now, and will move forward on this one and then updating all MRs to use a similar convention.
Comment #59
kristen polHere's the screenshots:
Props
Desktop
Mobile
Comment #60
kristen polOkay... I'm done with my tweaking :)
If this is looking okay, then I can use the same naming on other MRs.
Comment #61
phenaproximaComment #62
bernardm28 commentedIt seems to be working as expected though I could not add an image on experience builder. But that might be just related to that.
Comment #63
pameeela commentedThis is looking great based on the screenshots! Don't wait for my review, happy for a front end tick to get this merged.
Comment #64
thejimbirch commentedComment #65
phenaproximaAlright, folks seem to agree this looks good and I can find nothing to complain about in the code. Sick of seeing this one languish in review forever, so I'm merging it.
Comment #67
phenaproximaFinally merged into 1.x, thanks!