Problem/Motivation
Author's name shows up as blank if the author is anonymous in breadcrumbs when viewing a blog post. Causes orphaned possessive apostrophes.
Proposed resolution
Use similar implementation to d7 but remove the link (and extra s) on the final breadcrumb title "Anonymous' blog".
Remaining tasks
Patch.
User interface changes
Users won't see the orphaned apostrophe anymore.
API changes
None.
Original report by @thursday_bw
Display of › 's blog in breadcrumb and in links on blog pages when author is anonymous (ie. $node->name is empty)
to recreate this, create a new blog content at node/add/blog,
in the Authoring information > Authored by: text box
(notice the description: 'Leave blank for Anonymous.')
make this value blank.
save the blog and view it.
notice the ugly breadcrumbs and links
I have attached a patch which modifies modules/blog/blog.module to hide
the author name section of the breadcrumb and remove the link to the authors blog
when the author is anonymous empty($node->name)
It may be a better solution to insert the word anonymous in place of a blank name so the breadcrumb and link would be anonymous's blogs or possibly have a setting created to choose the functionality.
In our projects case we chose to hide it so that is what the patch does. for now.
Comment | File | Size | Author |
---|---|---|---|
#4 | Screenshot 2014-05-28 21.28.18.png | 29.16 KB | meeli |
blog_hide_author_from_breadcrumb_when_anonymous.patch | 1.55 KB | thursday_bw | |
Comments
Comment #1
thursday_bw CreditAttribution: thursday_bw commentedComment #2
Albert Volkman CreditAttribution: Albert Volkman commentedComment #3
meeli CreditAttribution: meeli commentedChecked this in d7 but someone has kindly made it say "Anonymous's blog" (probably shouldn't have an s after the apostrophe but that's for another day).
So we can keep this as a d6 bug. I tested it to confirm and I can definitely see the issue both in the breadcrumb and the link. Screenshot attached.
As for d8, blog is no longer in core.
The patch above is fine for the breadcrumb but needs updates for code style:
The patch provided will result in a breadcrumb that does not end at the current page... which is bad for various reasons. I think it would be better to use a similar approach to d7 but have no link (in d7 the link to Anonymous's Blog goes to blog/0 = 403 error).
Comment #4
meeli CreditAttribution: meeli commented