It would be nice if the blog.module output CSS in it's implementation of hook_links so that themes can style the links later (e.g. add a slick "blog" icon). The "read more" link already does this, and it makes styling a so easy it should be a crime.
The attached patch adds two classes to each "user X's blog" link: blog-link and blog-link-USERNAME. This allows themes to style every blog link and/or style specific user's blog links.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | blog-link-classes.57178.0014.patch | 807 bytes | karschsp |
| #9 | issue-57178-9.patch | 985 bytes | lilou |
| #6 | issue-57178-6.patch | 916 bytes | lilou |
| #4 | blog-class-7.x.patch | 937 bytes | lilou |
| blog.stylelinks.patch | 667 bytes | mfredrickson |
Comments
Comment #1
dmitrig01 commentednice idea but its due for a re-roll
Comment #2
psicomante commentedcould be useful a reroll?
Comment #3
panchoMoving feature requests to D7.
Comment #4
lilou commentedRe-roll.
Comment #5
Anonymous (not verified) commentedThe last submitted patch failed testing.
Comment #6
lilou commentedComment #7
cburschkaDoes our code-style allow for object members inside strings? I'll look it up; it just seems a bit unusual. Perhaps encase it in curly braces? I'd have chosen to concatenate here, but maybe that's up to personal preference.
Comment #8
cburschkaUpdate: The code style rules talk about "simple" variables, but they don't seem to explicitly state it one way or another.
Edit: The code-style checker doesn't moan about it either, so it's probably okay.
Comment #9
lilou commentedTypo corrected.
Add also
str_replace(' ', '_', $node->name)Comment #10
catchHow certain can we be that $node->name is XSS safe?
Comment #11
flickerfly commentedI applied the patch with fuzz: "Hunk #1 succeeded at 102 with fuzz 2 (offset -2 lines)."
Any merit to setting usernames to all lowercase? Perhaps that's just a pet peeve of mine. :-)
Comment #12
catchDo we want to go to the extent of usernames? Additionally usernames can be any utf-8 character, so that could result in invalid classes. I'd rather see user-[uid] there instead - which'd survive if users change their usernames too.
Comment #13
Tor Arne Thune commentedStill a valid issue after the release of 7.0. Moving to 8.x.
Comment #14
karschsp commentedPatch attached using $node->uid rather than $node->name.
Comment #15
karschsp commentedComment #16
deekayen commented#233301-125: Remove blog module from core removed blog from core.
Comment #17
nevergoneOutdated issue.