Hello,
The Views field handler with read more link theming is difficult. I created a patch, that give custom CSS class for the „read more” link.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | views_read_more_wrapper-1529718.patch | 3.36 KB | nevergone |
| views_read_more_link_css.png | 42.23 KB | nevergone |
Comments
Comment #1
nevergoneHere is the patch.
Comment #2
boobaaI think the checkbox is totally useless. It should be pretty straightforward that if one leaves the textfield empty, no additional classes would be added. Additionally, even the code would be more simplistic.
Comment #3
nevergone@Boobaa: All right, checkbox is deleted, and some performance tuning.
Comment #4
nevergoneSelf test, working.
Comment #5
dawehnerSo if you look at current code in views, the css classes are added after clicking a checkbox, not using one would make it more consistent.
The current code, though does not change the checkbox at runtime, but clears the values out, if the checkbox is not set.
This is done in views_handler_field::options_submit, so you could do this as well. At the end this allows to have an easy code when generating the more_link, and get a total consistent result.
You could check for !empty($more_link_class) as well, it makes the code a bit easier to understand.
Comment #6
stborchertFor a customer we needed to wrap the read more link into a HTML element so I modified the patch.
After applying the patch you can select a wrapper element for the link and add CSS classes to the wrapper.
Comment #8
nevergoneCorrected patch.
Comment #9
chris matthews commentedThe 6 year old patch in #8 to views_handler_field.inc applied cleanly to the latest views 7.x-3.x-dev, but still needs review.