Posted by dclardy on January 5, 2010 at 10:45pm
I am running a site where I am the only blog poster, and I do not like the link to my blog. It is on the bottom of the blog post. How do I remove this?
I am running a site where I am the only blog poster, and I do not like the link to my blog. It is on the bottom of the blog post. How do I remove this?
Comments
Looking through the page
Looking through the page source, I can see that this is how it is created.
<div class="links"><ul class="links inline"><li class="blog_usernames_blog first last"><a href="/blog/1" title="Read dclardy's latest blog entries.">dclardy's blog</a></li>
</ul> </div>
From what I can tell, this is made in the node.tpl.php. Where in this file do I remove the link to the author's blog? I need the read more link to still be there. This is how it is being created, but how can I find and remove links by node type.
<?php if ($links): ?><div class="links">
<?php print $links; ?>
</div>
<?php endif; ?>
You're sort of going about
You're sort of going about this the hard way. If you don't want a link to your blog, then why not just create using "Post" or "Page" instead? If you're building an actual website as opposed to a blog, then Post or Page (or even Story or Book) would do better for you. You'll still get the "Read More" link in teasers.
If you just have to use the Blog for posting, then look for a blog mod, Like Advanced Blog or some of the other great one's that will offer more control.
But really, IMHO, I'd wouldn't use the Blog posting unless I wanted the features of an actual Blog post. But if you want it removed, just delete or comment the entire ul class. What you listed should control the link to your blog.
Chris
Agreed there is no point to
Agreed there is no point to using blog. As Chris said story, page, or a custom type would be much easier.
Well
Ok, so you could use story, page or such things if you like.. However, as you're asking, and just for the fun of it, the code-change should actually be rather simple. (also, I prefer it when the actual solution to the actual question is posted, as well as or instead of just the bypass solution... So sue me... c¨,)
What you could do is to change the existing code:
<?php if ($links): ?><div class="links">
<?php print $links; ?>
</div>
<?php endif; ?>
to
<?php if ($links): ?><div class="links">
<?php if ($node->type != 'blog') {print $links;} ?>
</div>
<?php endif; ?>
I believe that should sort it, though you may want to further develop it to suit more or more specific needs...
Actually...
I was "reading between the lines" and trying to give him an easy way to accomplish what I believe he wanted. Why jump into the code and mod something that you may end up wanting to revert later? Doesn't make sense.
Part of helping in this forum is interpreting what users want to accomplish and supplying them the info to do this in the easiest manner. My solution wasn't a "bypass"... it was the proper way of doing things. Drupal offers so much flexibility, and what he wanted to do would be better accomplished using another post method that's already configured and present. A good rule of thumb is to never touch the code unless absolutely necessary. In his case, there was absolutely no reason to do so. And, as a side-note, your solution is incorrect.
Hey
First, no offence meant. I simply gave a solution that works (yes, I've tested it). He asked for code solution, so I gave him one. This is not a bad thing to do as far as I can tell, and I did not intend any harm whatsoever by my post. I agree that your solution is probably better from "a drupal point of view", but why not also include something that is a direct answer to what he asks as well? Do not understand why you get upset, but sorry about that.
Hi Vandalf
No offense taken. No problems. Maybe I took the tone of your post the wrong way. If so, I apologize as well.
No harm done. Hey... at least he got plenty of help :-)
Anyway, nice meeting you... and again, no offense taken.
Hope you have a great day!
Chris