Closed (outdated)
Project:
Blog
Version:
8.x-2.x-dev
Component:
User interface
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
25 Jun 2007 at 21:01 UTC
Updated:
2 Apr 2020 at 22:21 UTC
Jump to comment: Most recent
Currently, the 'Post new blog entry.' link on the blog/ page is hardcoded in blog_page_user().
For sites wishing to force users to use the 'create content -> blog entry' link, this should be moved to a theme function (cf. #100055). See attached patch for a possible solution.
| Comment | File | Size | Author |
|---|---|---|---|
| blog.module_7.patch | 1.97 KB | wulff |
Comments
Comment #1
andreashaugstrup commentedI'd like to see this patch make it in. It is frustrating that this tiny bit of output is not themeable. The main use case is when you want to *remove* the "Post new entry" link because it is sitting untouchable at the top of the page where it can look very out of place (not to mention hard to style with CSS).
Secondly one might is likely to want to provide a better explanation than "You are not allowed to post a new blog entry." to users who have had their blog posting permissions revoked.
Making the section themeable solves both these frustrations.
Comment #2
dmetzcher commentedThis never made it in, so I hacked the core a little to make "Post new blog entry." themeable (yes, I know we're not supposed to do this, but for something so small, I made a personal exception for myself). I'll just have to remember that I did this (I've made notes) the next time I upgrade Drupal so that I can re-hack this file when it's overwritten.
For anyone interested, edit blog.pages.inc, located in /modules/blog.
Change this (line 20 if you are running Drupal 6.16):
$items[] = l(t('Post new blog entry.'), "node/add/blog");to this:
$items[] = t('<div class="content-header-info-box"><p>These are the entries in your personal blog. You may add a new entry.</p><input class="form-submit" type="submit" value="Post a New Blog Entry" onClick="javascript:window.location=\'/node/add/blog\';" /></div>');You can really do whatever you want, but I wanted to create a submit button and be able to style it and I wrapped the whole thing in a div so that I could style that as well. There are is some text in there to let the user know that they are looking at their own blog entries, in case they didn't notice that it had their username at the top of the page. ;-)
Once the code above is modified, add the CSS and do whatever you want with the div and button, or remove the div and the text I've included altogether and just stick with the button for a minimalist approach.
content-header-info-box= the div's classform-submit= the submit button's classComment #3
deekayen commented#233301-125: Remove blog module from core removed blog from core.
Comment #4
nevergoneOutdated issue.