Oct 10 2007
Last update:

Drupal - Place Read More Link Before Add New Comment

Filed under: Content Management Systems » Drupal,
 

Controlling Link Placement in Drupal

Getting Drupal's links to line up like you want them is not always easy.  By default, the "read more" link on the front page is placed last in the item of links, while "add new comment" is placed first.  If you examine the page's CSS, you'll notice that comment_add is prepended by "first," while "node_read_more" is prepended by "last."  I think it's a lot more intuitive to place "read more" first, since I am likely to read the rest of the article before placing a comment.  To change around the link placement, insert the following code snippet in your theme's stylesheet:

li.last.node_read_more { text-align: left } <br />
li.first.comment_comments, li.first.comment_add { float: right }   

If you have more links in your links section than simple "read more" and "add new comment," (for example, "forward" or "print"), then you can apply these style changes to these declarations as well.  For example, to move the blog links after "read more" as well, you would use:

 
li.blog_usernames_blog

Read more link inline and immediately following teaser?

What if you would rather have the "read more" link immediately following the teaser, and not in the links section at all?  This is a common approach used by many sites, and it is a very intuitive approach since as your eyes leave the last sentence of the teaser they immediately fall upon the "read more" link.  Drupal has a contributed module, Read More Tweak, that is for this purpose.  Note, however, that during testing we've found that the nodeteaser and excerpt modules conflict with the use of this module.  So if you are using either of these modules your inline "read more" links may not appear at all. 

 

Your rating: None Average: 1.5 (73 votes)

Need to Organize? Visit Shoeboxed.com (Affiliate)

 
Your rating: None Average: 1.5 (73 votes)
Email this page PDF of this page Print this page
Leave a comment
(31)



Very nice!

Very nice! Thanks a lot.

How to display comment title

How do I display the "add new comment" heading ($content['links']['comment']['#links']['comment-add']) somewhere else on the page, ie. in node.tpl.php?

Well, that’s great, however

Well, that’s great, however what about additional options we’ve got here? Do you mind making one more post about all of them also? Many thanks!

Will not line up

Thanks for your post I used the code revision and it works just fine.

Controlling Link Placement in Drupal

We've experienced a similar problem with learn more - the fact that links simply don't appear for those nodes. We had also nodeteaser or excerpt established so we assumed that has been the problem. For now our option would be to use that CSS method above instead of the read a lot more tweak module. I used for a long period this helpful module "Read A lot more Tweak".

But used to do not know who's was incompatible with all the excerpt-module. However, after I tried out there the excerpt module, as I used to be looking for an identical feature. As I observed the incompatibility with all the read-more-tweak, I uninstalled the excerpt-module once more.

Read more approach

I like the approach you've used on this site - you're able to click on the article heading as well as on "read more..." to read the rest of the article. I think that gives the user plenty of options to continue reading your content.

Nice trick

You've done great work. Link placement is always important so thanks for this.

Read more links

Sheesh, c'mon Drupal. How difficult is it to see that people want a read more link right after the content? Drupal's default implementation of read more links is ridiculous - thank goodness there's people willing to create an improvement on this feature!

I used for a long time this

I used for a long time this helpful module "Read More Tweak"... but I did not know that it was incompatible with the excerpt-module... However, later I tried out the excerpt module, as I was looking for a similar feature...

Drupal read more

This is exactly what I've done, so I'm fine with this now I think.

Nice - I've been trying to

Nice - I've been trying to get the read more placement to work for some time now.

Great guide

Now that is what I call an excellent guide, thanks...

Wordpress is more user friendly

Sigh, why can't Drupal just be more user-friendly? I realize they're getting closer and closer with each version, but the placement of read more links is just another example of how far they're falling behind Wordpress in terms of user friendliness.

I prefer working with Joomla

I prefer working with Joomla - the easiest most robust CMS out there. The admin panel is a breeze, article posting is super easy, and with all the modules like CB and Virtumart there is very little limit to what you can do in Joomla.

And I prefer Drupal -- a lot

And I prefer Drupal -- a lot more power, yes, with more complexity but that's the price to pay. Try to learn it well and then everything falls into place.

Same problem here

I'm also getting two read more links - one is clickable and one is not, however one some sites only one will show up, while on others both show up. Any ideas?

I used for a long time this

I used for a long time this helpful module "Read More Tweak"... but I did not know that it was incompatible with the excerpt-module... However, later I tried out the excerpt module, as I was looking for a similar feature...

As I noticed the incompatibility with the read-more-tweak, I uninstalled the excerpt-module again. Unfortunately, since then the readmore-links disappear on *some* nodes (NOT on all but most nodes, while it does not matter, if the node was created in use with the excerpt-module or not). So I cannot get it back to working correctly.

RSS duplicate read more

This works great, however I'm having an issue with the "read more" link in my RSS feeds. Specifically, they are appearing twice. Once in the text body (unclickable) and then again as a link. It's not happening on all my sites, however, and I can't seem to figure out what's causing it? Any idea how to get rid of the text-only "read more" link?

Friendly read more links

Good article, now my read more links finally look good! I was about to switch to Wordpress. I realize that Drupal is a lot more powerful than some of the competing CMS systems out there (Wordpress, Joomla), but if its user-friendliness doesn't keep up, people won't notice.

YEAH you encompass my

YEAH you encompass my sentiment!!!!!!!!!!!!!!!!!!

Drupal's read more link placement

Thank you help for helping me resolve Drupal's strange "out of the box" link placement! If it's an industry standard to have "read more" links, why would Drupal use such odd link placement to begin with?

Thanks for this!

Thanks a ton - I've been trying to find a way to get my "comment" links to appear in a way similar to Wordpress for ages. Now I have the flexibility to place my read more links where I want them Smiling

Read more issue

how would the css be if I want different bg images to each link in the menu?

CSS menu background images

Hi Lara,

You can generally add background to your menu images using the following CSS (in this example the menus are generated using Drupal's Nice Menus module - you might need to adjust your CSS element accordingly):

#block-nice_menus-1 a { background: #fff url(example.gif) no-repeat top center }

css for read more links

Hi there,

We've experienced the same problem with read more - that the links simply don't appear for some nodes. We had either nodeteaser or excerpt installed so we assumed that was the problem. For now our solution is to use the CSS method above in lieu of the read more tweak module.

drupal read more link

Nice - I've been trying to get the read more placement to work for some time now. This is just the information i was looking for.

bg image

how would the css be if I want different bg images to each link in the menu?

sherif

Read More Tweak...

Hi,
I used for a long time this helpful module "Read More Tweak"... but I did not know that it was incompatible with the excerpt-module... However, later I tried out the excerpt module, as I was looking for a similar feauture... As I noticed the incompatibility with the read-more-tweak, I uninstalled the excerpt-module again...
Unfortunately, since then the readmore-links disappear on *some* nodes (NOT on all but most nodes, while it does not matter, if the node was created in use with the excerpt-module or not). So I cannot get it back working... correctly Sad

Do you have perhaps an idea, how I could get the tweak-module back working? How can i now fix this comflict?

Read more issue

Hi there,

We've experienced the same problem with read more - that the links simply don't appear for some nodes. We had either nodeteaser or excerpt installed so we assumed that was the problem. For now our solution is to use the CSS method above in lieu of the read more tweak module.

Re: Read more issue

Hi again,
Thanks for this quick reply... I'm sure it is the excerpt module (I never used nodeteaser) - but in my case deactivating/uninstalling the module does not help further.
Well, nevertheless I tried to implement the snipplet above (even though it is only a temporary solution for me). It did not work at first (< br /> tag!?!), but finally I got the thought of it for adjusting the other details too (except that the other links are now completely unordered?). Thanks!
If you hear of a better workaround or even a fix... please contact me...

Apropos... sorry, I did not even give a hint (in the first comment) about who I am...
hQuadrat (www.hQuadr.at)

Nice writing style. Looking

Nice writing style. Looking forward to reading more from you. Actually I am also related from Digitalxsteam that is your one stop online source for complete Professional Graphic Design. We provide all types of e-business solutions with satisfaction. For details, please visit on our website.

The content of this field is kept private and will not be shown publicly.
 

We use this trick question to try and prevent automated spam comments.