6

I have created the blog as a view in Drupal 7.14 site. On my main blog page, I want to show 5 trimmed versions of the posts. I have added the following fields for the main blog page view - Title, Author, Post date, Body. In the Body field, I select the following options in "Rewrite Rules" section - Trim field, add read more text. Btw, I have selected the default format for the body. I add the "More link path" as [title] after referring to the Replacement Patterns.

Rewrite Rules modal window When I apply the changes, I see that the "Read More" links to the actual title and not the url that is linked to the title. Example, it will create a link "www.mysite.com/My post title" instead of "www.mysite.com/blog/my-post-title".

In the Title field, I have selected the option to link the field to original piece of content. Title field settings

The same setup worked on my localhost and it is not working on my Joyent server. Am I missing something? I have spent several hours looking at concepts like Pathauto, replacement tokens, etc, but no help.

15

Just change the More link path to the node/[nid]

Add field nid to the views field and exclude from display. Make sure nid is above body field. Re-arrange the fields by clicking on select list next to field label and drag nid field to top of body field. It works !

Drupal l function while generating links will convert automatically to path alias blog/blog-title !

  • Thank you for the feedback. I added a field for [nid] and then tried adding [nid] and also node/[nid] as you suggested. It just blindly appends this to the site url. So, I end up getting a url "www.mysite.com/node/[nid]. Also, I noticed it does not get added to the replacement patterns. – designplusdev Sep 26 '12 at 2:10
  • Small changes need to be done ! Check updated answer ! Make sure nid is above body field. It works ! – Anil Sagar Sep 26 '12 at 2:17
6

You can also add a separate 'Content:Link' field:

Adding the content:link field

Then select the text you want to display on the 'Readmore' link (you may select a fixed text, or a dynamic text [like nodetitle] when you rewrite the field results).

0

I had the same problem - my assumption was the same as the OP's in that the "title" field/token would link, but it didn't, even when it was set to link to the original piece of content. I also tried the "link" field which also didn't work (same effects as reported above). It turns out the field you need is "path" - this has to be positioned above the body field (or whichever field it is you want to rewrite as the link to the node) in the fields list, and excluded.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.