This is an old issue. Despite numerous reports from users annoyed by it, it has not been fixed.
After each blog post, Drupal displays a link called "$user's blog", on both the front page and on each individual node page. This might be useful in some situations, but in other cases it's just annoying. There is no way to turn it off, other than patching the core.
Reproduce the bug:
Just post a few blog nodes.
I expected to be able to go to the Admin section and turn off the display of the "$user's blog" link.
Instead, there's no easy way to turn it off, other than hacking the core.
Some discussions and patches:
http://www.thesitewizard.com/blogging/remove-username-from-drupal-blog.s...
Comment | File | Size | Author |
---|---|---|---|
#22 | blog.module.patch | 507 bytes | florin |
#9 | blog.module.patch | 481 bytes | florin |
Comments
Comment #1
lomz CreditAttribution: lomz commentedI would love to get that line removed,
Comment #2
whirledview CreditAttribution: whirledview commentedsubscribed.
Comment #3
WorldFallz CreditAttribution: WorldFallz commentedAFAIK, this is not true. Try the following in the template.php file for your theme (be sure to empty the cache):
I can verify it works in d6.9.
Comment #4
Dave ReidOr use hook_link_alter in a custom module:
Comment #5
lomz CreditAttribution: lomz commentedCouldnt that be put in a module and shared with eveyone?
Comment #6
WorldFallz CreditAttribution: WorldFallz commentedI suppose it could-- but creating and maintaining a whole module for 3 lines of code? Doesn't seem very worthwhile to me....
Comment #7
lomz CreditAttribution: lomz commentedThen I'll do it, I have been sick of doing this manually, I am sure I am not the only one.
Comment #9
florin CreditAttribution: florin commentedPatch for 6.10 disabling $username's blog - see attached file.
Comment #10
bendshead CreditAttribution: bendshead commentedHow do you implement a (this) patch in Drupal?
Comment #11
WorldFallz CreditAttribution: WorldFallz commentedSee http://drupal.org/patch/apply
However, patching a core module is not a good idea-- you essentially create a fork that must be manually maintained through every drupal upgrade going forward. This is particularly true when what you're trying to accomplish is easily handled with an override as described in the comments above.
Comment #12
bendshead CreditAttribution: bendshead commentedI'm using Drupal 6.10 and tried the override under comment #3. It is causing issues, however.
In IE, my site just hangs -- never loads page. In Firefox, I receive the below error message.
* warning: Cannot modify header information - headers already sent by (output started at mysite/www/themes/litejazz/template.php:3) in mysite/www/includes/common.inc on line 141.
* warning: Cannot modify header information - headers already sent by (output started at mysite/www/themes/litejazz/template.php:3) in mysite/www/includes/common.inc on line 141.
* warning: Cannot modify header information - headers already sent by (output started at mysite/www/themes/litejazz/template.php:3) in mysite/www/includes/common.inc on line 141.
* warning: Cannot modify header information - headers already sent by (output started at mysite/www/themes/litejazz/template.php:3) in mysite/www/includes/common.inc on line 141.
* warning: Cannot modify header information - headers already sent by (output started at mysite/www/themes/litejazz/template.php:5) in mysite/www/includes/common.inc on line 141.
Comment #13
WorldFallz CreditAttribution: WorldFallz commented@bendshead that's usually caused by some misbehaving whitespace-- double check you don't have any stray characters in the template.php file (especially at the very top or bottom). Also, make sure you don't have a closing
?>
at the bottom of the file.Comment #14
-Anti- CreditAttribution: -Anti- commentedSorry to resurrect this.
The link itself is very useful.
It's just the incorrect implementation of the apostrophe that is embarrassing.
So how would you just get rid of the 's, but leave the link?
Eg. link reads: Fred blog
Or better, get rid of the name and apostrophe completely, but leave the link?
Eg. link reads: Blog or ideally: Go to Blog
Note that this link should be translatable using the locale module.
Also, the fix needs to apply to the blog TITLE too!.
When you build a website for your company, and your boss has a name ending
with 's', this is an extremely embarrassing bug.
Thanks.
Comment #15
WorldFallz CreditAttribution: WorldFallz commentedIt's passed through t() so it is translatable. But links are easily manipulated.
Put the following in your template.php file:
Comment #16
-Anti- CreditAttribution: -Anti- commentedSorry I get this error:
Fatal error: Cannot redeclare phptemplate_links() (previously declared in /home/USER/public_html/dev/sites/all/modules/menutrails/menutrails.module:428) in /home/USER/public_html/dev/sites/all/themes/THEME/template.php on line 64
I noticed these two modules, which will help with the blog title:
http://drupal.org/project/blogtitle
http://drupal.org/project/advanced_blog
But they don't do anything to the link at the bottom of the blog posts.
So thanks for any further input.
Comment #17
WorldFallz CreditAttribution: WorldFallz commentedThat means you already have a phptemplate_links function somewhere in the template.php-- you can just add the following to that existing function (before the return statement):
(that first 'if' should have been in the code above as well)
Comment #18
-Anti- CreditAttribution: -Anti- commentedSorry... but it's not in the template.php, it's in the menutrails module.
I guess this means that I can't use this particular fix.
Comment #19
WorldFallz CreditAttribution: WorldFallz commentedNope--- just change the function name to yourtheme_links and put it in the template.php file (or add #17 to any existing yourtheme_links function). If all else fails, it can be done in a little custom module (as mentioned by DR in #4) but try this first.
Comment #20
-Anti- CreditAttribution: -Anti- commented> Nope--- just change the function name to yourtheme_links
Ah... thanks! I'll try that later.
Comment #22
florin CreditAttribution: florin commentedNo changes for 6.13, same patch essentially.
Comment #23
WorldFallz CreditAttribution: WorldFallz commentedpatching the core blog module while other non-core destructive methods exist is not recommended.
Comment #24
WorldFallz CreditAttribution: WorldFallz commentedComment #25
willeaton CreditAttribution: willeaton commentedUpdated code due to some typos and mistakes/changes in versions...
This in a module using the hook_form_alter() will remove the link...
Thanks
Will Eaton
Drupal Developer
http://www.williameaton.co.uk
Comment #26
cside CreditAttribution: cside commentedIf anyone is interested this can be removed with css:
#content .blog_usernames_blog {display: none;}
Hope that helps someone looking for a quick fix.
Comment #28
smscotten CreditAttribution: smscotten commented@-anti-
If your boss's name ends with an 's', you should add an apostrophe and an 's' to make the possessive eg "James's blog". The current behavior is correct.
Exception: if your boss is royalty or a prophet eg "Moses' laws" or "Prince Charles' ears"
I guess the other exception is if you have two bosses named James and they both share the same blog. That would be "James' blog".
None of this changes your point, of course.
Comment #29
-Anti- CreditAttribution: -Anti- commentedThanks for your input. There are a couple more relevant exceptions though:
My boss's name ends in a hard 'z' sound.
Eg. Mr Chambers should become Mr Chambers' blog
Also we have some employees' names with double ss endings.
Eg. Mr Moss should become Mr Moss' blog
This application is debatable (as some people would write Mr Moss's)
But I don't like it; it looks more formal, neat and professional the other way.
Cheers.
Comment #30
-Anti- CreditAttribution: -Anti- commentedHaving just got round to revisit this issue again, I now understand that all
the fixes in this thread only apply to the link at the bottom of a node.
What I really need is to stop the TITLE appearing at the TOP of the blog teaser page.
Or even better, change it so it reads: Blog: $USERNAME
Is there any way to do that?
I can see the following in the blog module:
And I guess I'd like to edit that to:
drupal_set_title($title = t("Blog: @name", array('@name' => $account->name)));
but I have no idea how to do that without hacking the module itself.
Cheers.
Comment #31
WorldFallz CreditAttribution: WorldFallz commentedYou could adapt a function to do the possessive:
Comment #32
WorldFallz CreditAttribution: WorldFallz commented@#30:
You might be able to do that in a node preprocess function with http://api.drupal.org/api/function/drupal_set_title
Comment #33
-Anti- CreditAttribution: -Anti- commentedSorry, I edited my post while you typed your reply.
OK, I kind of understand that script; it seems it would work for my purpose.
Where would I put it so that it over-rides the blog module?
Would I really call it 'mymodule_possessive'?
Perhaps avoiding the possessive altogether might be better?
Eg. Blog: @name would do fine.
Thanks.
Comment #34
-Anti- CreditAttribution: -Anti- commented> You might be able to do that in a node preprocess function with http://api.drupal.org/api/function/drupal_set_title
Sorry, that means absolutely nothing to me.
I couldn't even print 'hello world' in php without having to look up how to do it.
EDIT1:
Is putting the following script in template.php close to what you mean?
function THEME_preprocess_blog_page_user {
drupal_set_title($title = t("Blog: @name", array('@name' => $account->name)));
}
I really haven't a clue.
EDIT2
This doesn't appear to work, but am I getting close?
function fusiontheme_preprocess_blog_page_user (&$vars) {
$vars ['title'] = t("Blog: @name", array('@name' => $account->name));
}
EDIT3:
Just shooting in the dark now:
function fusiontheme_preprocess_blog_page_user ($title) {
$title['title'] = t("Blog: @name", array('@name' => $account->name));
return drupal_set_title($title);
}
OK, those were my best attempts after 2 hours and hundreds of tries.
I have no idea what to do next.
Thanks for any assistance.
Comment #35
WorldFallz CreditAttribution: WorldFallz commentedi played around with this quite a bit and couldn't get it to work right in the theme layer (i never use the blog module). I think it probably has to be done in a module. If I get a chance to figure it out i'll post back.
Comment #36
-Anti- CreditAttribution: -Anti- commentedFor now, I've just edited line 15 in blog.pages.inc:
drupal_set_title($title = t("Blog: @name", array('@name' => $account->name)));
Obviously that isn't very good practice though.
Thanks.
Comment #37
mshepherd CreditAttribution: mshepherd commented#4 worked after slight modification as follows:
Comment #38
David_Rothstein CreditAttribution: David_Rothstein commentedSee also #792062: Blog links don't make sense for a single-user blog which would try to make the blog module a little smarter automatically about when to show this link.
Comment #39
wa2nlinux CreditAttribution: wa2nlinux commented#3 Work well on my site
Comment #40
TechMagician CreditAttribution: TechMagician commented#26 worked for me, implemented the CSS using module: http://drupal.org/project/css_injector
Comment #41
cookiesunshinex CreditAttribution: cookiesunshinex commented#3 works on Drupal 6.20 for me.
It works with Opera, Safari, Chrome, and Firefox on Mac OS X.
Comment #42
eddison CreditAttribution: eddison commentedOk for those of us who don't eat code for din din's (like me) here is a newbie guide:
As was stated above post number 26 worked on my site http://translationof.com i have the blogs organised as a type of forum, which suits my purposes. I have 6.22, not drupal 7 so recent modules don't work. but this solution is elegant.
I uploaded this module http://drupal.org/project/flexible_blogs which allows one to place code in drupal (especially if you don't know where to put it, and no one is telling you!). Enable module, give yourself permission (you deserve it) and go to;
site configuration
CSS injector Then click
'create new rule' then call it something like remove username blog like, then place this code in the window
#content .blog_usernames_blog {display: none;}
And click save.
Now all links like someone's blog should be gone!!
Thanks to cside for the code, and David_Rothstein for the nice module!
Comment #43
klidifia CreditAttribution: klidifia commentedThanks this is much simpler...
Also this stuff appears in the breadcrumbs!
This is what I did...
Created a new template file: node-blog.tpl.php
Added this css at the top:
#content .blog_usernames_blog {display: none;}
#breadcrumbs {display: none;}
Comment #44
MarioTorresp CreditAttribution: MarioTorresp commentedIn Drupal 7 edit only node.tpl.php:
unset($content['links']['blog']['#links']['blog_usernames_blog']);
Comment #45
chaiwei CreditAttribution: chaiwei commentedFor drupal 7, I am using hook_node_view_alter()
Comment #46
RobertOak CreditAttribution: RobertOak commentedditto #45 works for D7
Comment #47
knalstaaf CreditAttribution: knalstaaf commented#45 works indeed, but
modulename
isthemename
in my case (and it's put in my template.php).Thanks.
Comment #48
kkalaskar CreditAttribution: kkalaskar commentedThanks chaiwei, #45 Worked for me.
Comment #49
AlsA quick and focused solution for D7 is explained on Templatemonster.
In short:
- open current theme's node.tpl.php
- find "hide( $content[‘field_tags’] )"
- add "hide($content['links']['blog']);"
See their page for details:
https://www.templatemonster.com/help/drupal-7-x-how-to-remove-admins-blo...
Comment #50
jorgemontoyab CreditAttribution: jorgemontoyab commented#45 + #47 worked for me. Thanks!
Comment #51
mdalda CreditAttribution: mdalda commentedtemplate.php version: