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.

Comments

dmitrig01’s picture

Version: x.y.z » 6.x-dev
Status: Needs review » Needs work

nice idea but its due for a re-roll

psicomante’s picture

could be useful a reroll?

pancho’s picture

Version: 6.x-dev » 7.x-dev

Moving feature requests to D7.

lilou’s picture

Status: Needs work » Needs review
StatusFileSize
new937 bytes

Re-roll.

Anonymous’s picture

Status: Needs review » Needs work

The last submitted patch failed testing.

lilou’s picture

Category: feature » task
Status: Needs work » Needs review
StatusFileSize
new916 bytes
cburschka’s picture

"blog-link blog-link-$node->name"

Does 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.

cburschka’s picture

Update: 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.

lilou’s picture

StatusFileSize
new985 bytes

Typo corrected.

Add also str_replace(' ', '_', $node->name)

catch’s picture

How certain can we be that $node->name is XSS safe?

flickerfly’s picture

I 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. :-)

catch’s picture

Title: Add CSS to "read X's blog" links » Add classes to "read X's blog" links
Status: Needs review » Needs work

Do 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.

Tor Arne Thune’s picture

Version: 7.x-dev » 8.x-dev

Still a valid issue after the release of 7.0. Moving to 8.x.

karschsp’s picture

Status: Needs work » Needs review
StatusFileSize
new807 bytes

Patch attached using $node->uid rather than $node->name.

karschsp’s picture

Assigned: Unassigned » karschsp
deekayen’s picture

Project: Drupal core » Blog
Version: 8.x-dev » 8.x-2.x-dev
Component: blog.module » User interface
nevergone’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

Outdated issue.