Community

Remove the '"sernames blog" at the end of blogs DRUPAL 7

Go to "modules/blog/" and edit "blog.module"

Search for usernames_blog and you will be shown the following code:

function blog_node_view($node, $view_mode) {
if ($view_mode != 'rss') {
if ($node->type == 'blog' && (arg(0) != 'blog' || arg(1) != $node->uid)) {
// This goes to l(), which escapes !username in both title and attributes.
$links['blog_usernames_blog'] = array(
'title' => t("!username's blog", array('!username' => format_username($node))),
'href' => "blog/$node->uid",
'attributes' => array('title' => t("Read !username's latest blog entries.", array('!username' => format_username($node)))),
);
$node->content['links']['blog'] = array(
'#theme' => 'links__node__blog',
'#links' => $links,
'#attributes' => array('class' => array('links', 'inline')),
);
}
}
}

If you are like me, don't know a whole lot about php, and you find this link to be annoying when you only have one person doing all of your blogs, you can simply disable/remove this is by adding:

/********** right before the code and ********/ at the end of the code. It will be skipped over when the blog.module is read, therefore removing the usernames_blog link.

Comments

Oon your next Drupal update,

Oon your next Drupal update, you'll find that isn't the best solution.

Jaypan We build websites

?...

Why is that? I have updated to 7.18 and it still works like a charm ... I have no issues.

Because it's editing core

Because it's editing core files, which get overwritten on updates, meaning you have to keep going back and re-editing the core file after each update.

If this didn't happen with you, then you'll have to explain your update process.

Jaypan We build websites

Ah ok! Well that makes sense,

Ah ok! Well that makes sense, but I guess this update didn't touch the blog module.

I downloaded the zip and extracted it on the server letting it override any files that needed to be updated

=-=

if you extracted the entire archive then the blog module had to have been overwritten as well. Else, you didn't upload all files from the latest release. While the blog.moudle file itself may not have been updated at all for the last update, it's included as all drupal core files are in every release.

=-=

hacking core is a terrible way to deal with this when one can use CSS to hide it or bypass use of the core blog.module (it's not part of D8) and create your own blog content type.

Could you explain ...

How you you hide this using CSS or why have th blog module at all if you are just going to bypass it? for such a small problem it works great!

=-=

@ hide with CSS: you can use a display: hidden; on the element in question

@ bypass it: you can create your own blog content type, create your own lists with views or use lists provided by taxonomy. IMHO , creating a blog this way, especially when it's a single user blog provides far more control and is one less thing to worry about dealing with when upgrading to D8 (which won't have the blog.module as part of the default download)

@ why have it at all if you can bypass it: not sure I understand the question. It's a part of drupal core and has been for quite some time. Before the ability to create custom content types in core, before views.module (which is also part of core in D8). It's a legacy module which really isn't needed any more but upgrade paths were.

oh ok ... Im still new with

oh ok ... Im still new with Drupal and that was the quickest and easiest route for me to take.

nobody click here