Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By fresh-off on
Hello,
I'm using the blog module for blog posts and i cant figure out how to remove the "author's blog" that gets placed at the bottom of the blog next to the "read more..." and "add a new comment" links.
I've created a node-blog.tpl.php, and i know that <?php print $links; ?>
is where the links get written to the page, and after searching all day i still cant figure out how to make sure the author's blog is NOT included.
thanks for any help!
Comments
after a few more days of googling around
am i on the right track to use a
phptemplate_preprocess_node()
function inside template.php?i really dont know php too well - but here's as far as i've been able to get with trying to remove the blog_usernames_user (writes "author's blog" to the page) from my blog:
that throws the following error in template.php: Parse error: syntax error, unexpected T_UNSET
I dont really know what else to do next. am i on the right track? if so, how can i remove blog_usernames_blog from the links array?
I dont think i can upload images to Drupal.org, so the following link is a screenshot of the info i get using the Devel Module:
http://fresh-off.com/work/indigo/web-devel-screenshot.gif
I am fairly new as well but I
I am fairly new as well but I know this is something I'll be doing too. Although I won't be working on this for a few days (maybe this weekend)- I'll let you know if I find anything during my search.
Check this out...
On the Drupal Themes Mailing List, CK Ng over at http://fordrupal.com was nice enough to shoot me this code for removing the author's username from the blog! I still havent gotten it to work quite yet, but its farther than i would ever have gotten on my own!
I'm hoping some Drupal/PHP Ninja might be able to take a look at it and show me where the syntax error is. I placed it into template.php and get the following error:
Parse error: syntax error, unexpected T_STRING.
I cant seem to find it.Perhaps I didnt quite understand his directions here:
Here's the way I entered the code:
I've looked through the snippet above, and the rest of the code (posted in its entirety below) and cant find the syntax error. I've tried messing about with single and double quotes, and some other stuff, but when i've gotten rid of the error, blog_usernames_blog still posts to the page.
Here's the code (in its entirety) that CK Ng sent me:
Thanks again CK Ng!!! - my PHP skills aren't too great, but hopefully I get it working soon!
Have you checked theme settings?
Depending on the theme you are using you may be able to make this change through the admin page.
Most themes have an option to deselect the content types you don't want this information displayed for.
Sorry I've done this twice today
Sorry. I've done this twice today.
What I should have asked is whether you might be able to just hide the display using a display: none style in the css
feeling a little silly now...
heh heh.. i feel dumb now. display: none worked.
Its my first complex theme from scratch, so i guess my line of thinking was to make sure it wasnt included, rather than "commenting" it out. I'm still looking forward to the day when i have more control over the output of my content types, but i guess that's just the learning curve!
thanks wildpoppy!!!
edit: for anybody reading this thread later on, display: none works, but it seems to have left some interesting spacing issues with the rest of the Unordered List. At first glance however, if you've got moderate CSS skills it should be easy enough to take care of.
fresh-off, you are welcome
fresh-off, you are welcome =)
Check that you don't have other hook_links, esp. YOURTHEME_links(), the only think which should prevent the code from working.
You can try this instead, a shorter version, without the <?php ?> tags (used here for syntax highlight to work only)
phptemplate_links() can be replaced by YOURTHEME_links()
Using CSS display:none has 1 drawback, thing like search engine will still see it. =)
Thanks; worked perfectly! For
Thanks; worked perfectly!
For others: make sure you take out the php tags that ckng mentioned. I skimmed over his instructions and missed that part initially.
_
For future reference:
http://drupal.org/search/apachesolr_search/remove%20blog%20link
Leads to A link called "$user's blog" is printed after each blog post and cannot be removed (first link) which has the 4 lines of code solution.
a module called "blog title"
a module called "blog title" allows you to hide the "authors blog" link
http://drupal.org/project/blogtitle
Removing authors details from parts of the page
Don't know whether this is what you are after but I was rooting to find out how to remove the posted by etc name, date from various elements on the page and was reading Drupal 6 Themes. The book advised to go to admin/build/themes and click the configure link at the side of your chosen default theme. There you will see a tab called 'global settings'. In there is an option to remove author (posted by, etc), date and so on from various content options across your site e.g. page, story, etc.
Switch off the ones that you don't want displayed, hit save and no longer do the names and dates of postings and comments appear in your content.
Sorry, if this is not what you were after. After spending some time trying to find this particular thing myself I thought it might be useful to someone out there as we do all tend to be rooting for similar solutions on drupal.org.
thanks
admin -> themes -> configure
admin -> themes -> configure -> global settings -> Turn author name off (choose the various node / content types you want to NOT display author details for. Its built into drupal so no need to hack the code.
I couldn't find the option to
I couldn't find the option to do this on D7. Is there an alternative to remove the author info only from a news content type (only the author info, not the submitted date)
_
yep... in d7 it was moved to the individual content type settings.
Thanks, although it applies
Thanks, although it applies for author and date submitted. I would like to be able to remove only the author info...
_
that's all that core provides. If you want to customize it, then you should deselect it in the content type, and create your own template file (either node.tpl.php for all content types, or node-{type}.tpl.php for a specific content type) to put it where/how you want.