Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is not a clear way to select the read-more link on trimmed text field output for css styling. I don't know if there is a better solution than the attached patch. It simply adds a class of "more-link" to that link.
Comment | File | Size | Author |
---|---|---|---|
#7 | views-more_link_class-7.patch | 695 bytes | John Franklin |
#3 | views-more_link_class-1557926.patch | 627 bytes | ditcheva |
views_handler_field_more_link.patch | 744 bytes | pdcarto | |
Comments
Comment #1
dawehnerUpdate status. Thanks for the patch!
One problem with adding a class might be, that it could break people's layout because more-link is quite generic...
Comment #2
tim.plunkettWhat about
views-more-link
?Also, please include spaces around
=>
Comment #3
ditcheva CreditAttribution: ditcheva commentedI agree about making the class more specific. I need this feature also, so I'm making the required changes.
Thanks!
Comment #4
dawehnerThis looks fine!
Comment #5
dawehnerYeah patches!
Committed to 7.x-3.x and 8.x-3.x
Comment #7
John Franklin CreditAttribution: John Franklin commentedFor those coming here looking for a D6 patch, the attached patch does the same.
Comment #8
codemode01 CreditAttribution: codemode01 commentedOld thread, but thought I'd share...
(D7)
If you're looking to add a class to the read more "field" added to trimmed text, you can approach it with Display Suite under the Manage Display tab on the content type.
I was using a Display Suite, 2-column layout and wanted to match the read more link color to the rest of my site. I went to the Manage Display tab, opened the settings (gear icon) on the read more "field" and added a "readmore" class to it... saved it and went back to inspect the code - nothing! It wasn't until I assigned a wrapper tag (the "Wrapper" input textarea) that the class was applied, and it was applied to the wrapper.