Using DS fields like e.g. the "Read more" field for nodes would begreat if not only their wrapper but also the link itself could get a custom class defined. This would allow to support colorbox links and the likes and I'm sure lots of more use cases. I'm going to submit a patch in a minute.

Comments

jurgenhaas’s picture

StatusFileSize
new1.77 KB

Here is the patch to support link classes for the "Read more" link.

tobias.grasse’s picture

Status: Active » Reviewed & tested by the community

Rolled the patch from #1 against 7.35 and it works perfectly. Solves a recurring need in DisplaySuite, thanks!

jurgenhaas’s picture

Any chance of getting this committed soon?

aspilicious’s picture

So correct me if I'm wrong.

I think the class on the wrapper is enough for styling.
But in order to make colorbox work out of the box you need additional classes on the link. Correct?

jurgenhaas’s picture

Yes, that's correct.

tobias.grasse’s picture

Not only for colorbox and similar modules, but also for frameworks like Bootstrap or Foundation to work as intended: For example, .button on a wrapper doesn't wield the same behavior as .button directly on the <a> tag. If you put it on the wrapper, only the button text is actually clickable, but users would expect the whole button to be a clickable area. Sure, you can recreate the behavior in your custom CSS, but that defeats the point of using a framework.

Long story short: Please integrate this patch :-) IMHO, it solves a real need and doesn't impair or alter the rest of DS' functionality.

aspilicious’s picture

Assigned: Unassigned » bceyssens

bceyssens’s picture

Status: Reviewed & tested by the community » Fixed

I added a description to the link class field.
Thank you for your patch jurgenhaas!

bceyssens’s picture

Version: 7.x-2.x-dev » 8.x-2.x-dev
Status: Fixed » Patch (to be ported)
bceyssens’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jurgenhaas’s picture

Status: Closed (fixed) » Patch (to be ported)
StatusFileSize
new1.57 KB

This should be back ported to the d7 version of the module too.

aspilicious’s picture

I think this is committed but not part of latest release. Can you check the dev version?
I'll do it myself but I have limited resources and I'm focusing on D8 for now.

kalistos’s picture

I need this patch for 7 version. Can we apply it for 7?

UPD: it's applied in dev branch.

jurgenhaas’s picture

The patch in #14 is for version 7.

aspilicious’s picture

Status: Patch (to be ported) » Fixed

This is already part of the dev branch.
Will create a new stable release today.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.