remove Read more link

ks.sundarrajan@... - March 11, 2008 - 12:22

Can anyone tell me how to remove the "read more" link on nodes ?

Edit the node.tpl.php

nijulay - March 11, 2008 - 20:08

Edit the node.tpl.php

<div class="content">
<?php
   
if( $main && $node->readmore )
    {
       
$content = "$node->teaser<p>" .
           
l( t("read more"), "$node_url", array( "title" => t("Read the rest of this posting."), "class" => "read-more") ) .
           
"</p>";

       
// remove "read more" link from standard node links
        //$my_links = link_node( $node, $main );
       
$my_links =$node->links;
        if(
$my_links )
        {
           
// this would be much easier if the array returned by module_links() was indexed
            // see <a href="http://drupal.org/node/view/636">let _link() return structured link info</a>
           
$rm = preg_quote( t("read more") );
           
$my_links = preg_grep( "/$rm/", $my_links, PREG_GREP_INVERT );
           
$links = theme( "links", $my_links );
        }
    }

    print
$content;
?>

  </div>

remove Read more link

ks.sundarrajan@... - March 12, 2008 - 05:23

Thank u for the reply, but i am afraid that did not work...

my node.tpl.php file contains the following content--

<?php
if ($picture) {
      print
$picture;
    }
?>

<?php
if ($page == 0) {
?>

<?php
print $node_url
?>

" rel="nofollow">
<?php
print $title
?>

<?php
};
?>

<?php
print $submitted
?>

<?php
print $terms
?>

<?php
print $content
?>

<?php
if ($links) {
?>
»
<?php
print $links
?>
<?php
};
?>

-->

I edited the contents of the ..... as u said, but did not work
could u please help me?
I am using drupal 5.0

Thank u in advance

In node.module there there

krishnarp - March 12, 2008 - 05:42

In node.module there there is a function node_link(), which provides the read more link.
hope this you actually needs

krishna

remove Read more link

ks.sundarrajan@... - March 12, 2008 - 06:03

Sorry for the improper posting of the code... i forgot to use the code tag... I apologise again.

By the way, my problem is solved....

Thanks to Mr. krishna whose suggestion worked fine...

Thanks to all who tried to help me on this.
I will keep in touch with u all.

Thanks again.

hi all Me too facing the

jovemac - April 25, 2008 - 12:42

hi all

Me too facing the same issue. I am using drupal 6.2. I have given the default front page as node. Then i did the posting which is appreaing as a teaser. I want the full post to appear in the front page.

My node.tpl as below.

<?php
phptemplate_comment_wrapper
(NULL, $node->type);
?>

<?php
print $picture
?>

<?php
if ($page == 0):
?>

<?php
print $node_url
?>

" title="
<?php
print $title
?>
" rel="nofollow">
<?php
print $title
?>

<?php
endif;
?>

<?php
if ($submitted):
?>

<?php
print t('!date — !username', array('!username' => theme('username', $node), '!date' => format_date($node->created)));
?>

<?php
endif;
?>

<?php
print $content
?>

<?php
if ($taxonomy):
?>

<?php
print $terms
?>

<?php
endif;
?>

<?php
if ($links):
?>

<?php
print $links;
?>

<?php
endif;
?>

Please help how to edit it.

An easy solution I found

ackologic - July 15, 2008 - 18:59

An easy solution I found that seems to work is placing the "<!--break-->" at the very end of your post. When I did this the "read more" link just doesn't appear. No hacking necessary.

 
 

Drupal is a registered trademark of Dries Buytaert.