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
- Open your existing view or create a new view.
- Add fields from Fields section.
add these fields in same order.
- Content : Name
- Content : nid
- Content : Body
- After adding these fields, click on Body link from under fields.
- 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“.
- 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.