- Issue created by @kaipipek
- Status changed to Postponed: needs info
4 months ago 11:27am 1 August 2024 - 🇮🇩Indonesia gausarts
Thank you.
> Twig customization
Does it work if using default/shipped template, and removing your customization? I tested with Olivero theme and same behaviour: video is tiny and images are full width.
- 🇮🇩Indonesia gausarts
Not about how come, not clear here :)
There is an option named Image linked by Link field under Media switcher option. Be sure to choose the dedicated Link field under Link option.
This will wrap your media image with this link.
Then you want exclude video, you can unwrap this link using the provided hook_alter almost like you did. But easier. I tried Image linked by Link setting and the slide is wrapped with a link but it is not the right link which is one the fields of slide content. What am I doing wrong?
- 🇮🇩Indonesia gausarts
A good sign.
See #5, updated with new info.
Do not use emails, sometimes I updated my comments with extra useful info.
The links that are rendered around the slides point to the slide content node and not to URL in the link field of the node. However, the link field is correctly rendered as plain text if I add it into the fields of the view as Content:Link. It does not seem to matter if I select the link field under Fields or Caption fields in Style settings.
- 🇮🇩Indonesia gausarts
Check your selected View mode option. Verify that this view mode has the link field visible, in case hidden.
Be sure to reuse the exact same link field and image field for the entire media types to work as mixed media contents.
Remember this link and image fields are existing in the Media type Manage display, not Content type/ node one.
Please paste your formatter form to better see the culprit.
- 🇮🇩Indonesia gausarts
You are confused between the link in node vs in media.
You want to create a new or reuse existing link field in Media types > Manage fields/display.
Because you are dealing directly with Content:Media an sich.
Thus the fields must exist in Media, not Content or Node. Once they exist in Media entity, you can select them as options in this Media formatter.
I understand now that the issue is that my link field exists in Content/Node, because they are slide specific e.g. Product 1, Category B etc. and not media specific because same media is reused around the site. I suppose I need to use my hook for wrapping slides with content links as previously and figure out the namespace issue in case of video media.
Here are my style settings:
- Status changed to Fixed
2 months ago 4:54am 15 September 2024 - 🇮🇩Indonesia gausarts
The previous answers to focus on and separate Media field formatter which handles the link from Slick Views should fix OP.
However should you want to use the hook_alter, that will do, too, but not as robust as Link inside a Media formatter.
For reasons:
Link in Node will only have one link applied to all Media items, while Link in Media will be unique to each Media item.However up to your design requirements, if that serves your purpose.
Automatically closed - issue fixed for 2 weeks with no activity.