Hello.
I want to print "Read More " only after 100 characters.
I have a view with 4 articles .3 of them have only 20 characters and i dont want to print "Read More".I doesnt make sense the full article is in the teaser.
How can I fix that?

Comments

Snehal Brahmbhatt’s picture

Issue summary: View changes

Hi ltodoran,

This issue is fixed in Drupal's latest version but for those users who uses version 6.22, below is the work around.

You can use following module for adding Custom PHP Field in your view

- Views CustomField module

And by adding following code you can display View More Link based on Condition which you want.

<?php
if(strlen($data->node_revisions_body) > 100) 
    print l('Read more', drupal_get_path_alias('node/' . $data->nid));
?>

More Details :- http://www.amaslo.com/2012/12/drupal-conditional-read-more-link-in.html

Let me know in case of any concern/query regarding this.

Thanks,
Snehal Brahmbhatt | AddWeb Solution
Email: contact@addwebsolution.com

Status: Active » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.