Add read more link in drupal 7 views after certain words or characters

Add read more link in drupal 7 views after certain words or characters, If you have created a view for a content type and want to add read more link if that content node has more than certain number of characters or words then only. Here i will add read more link to that node. This can be done without using any external modules.

Follow these steps to add read more link in drupal 7 views after certain words or characters

  1. Open your existing view or create a new view.
  2. Add fields from Fields section.
    add these fields in same order.

    • Content : Name
    • Content : nid
    • Content : Body
  3. After adding these fields, click on Body link from under fields.
  4. Popup window will be displayed with all the values.
    • From Formatter, select Default
    • Below you can find REWRITE RESULTS collapse link.
    • Find this check box “Trim this field to a maximum length“, and enable it
      • Maximum Length : enter the characters
      • check this box “Trim only on a word boundary“.
      • Check this box to “Add an ellipsis“.
      • Check this box to “Add a read-more link if output is trimmed“.
        After enabling this check box, other options will be shown.

        • Enter more button text in this input field “More link text“.
        • Enter node/[nid] in this input filed “More link path“.
  5. After adding all these details save the view.

I hope this article helped you. If you are interested to learn more about drupal 7 please follow the series Step by step guide to learn drupal7 by subscribing to newsletter or get latest news and updates by following us on twitter & facebook. If you have any feedback please let us know by using comment form.

Vivek Vengala
 

Vivek Vengala is a Online Entrepreneur, Web Developer from Hyderabad India.

Click Here to Leave a Comment Below 0 comments

Leave a Reply:

x

Join My Facebook Group to Receive Coding Tutorial for Free

email-subsribe