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

Comments

nijuley’s picture

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>

kssundar’s picture

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

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

if ($sticky) { print " sticky"; } if (!$status) { print " node-unpublished"; } ">

 if ($picture) {
      print $picture;
    }

if ($page == 0) {

print $node_url"> print $title

};
print $submitted
print $terms

print $content

if ($links) {

};

-->

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

Regards,
Sundar

krishnarp’s picture

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

krishna

kssundar’s picture

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.

Regards,
Sundar

jovemac’s picture

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.

phptemplate_comment_wrapper(NULL, $node->type);

print $node->nid; " class="node if ($sticky) { print ' sticky'; } if (!$status) { print ' node-unpublished'; } if ($page == 0) { print ' teaser'; } ">
print $picture
if ($page == 0):

print $node_url " title=" print $title "> print $title

endif;
if ($submitted):
print t('!date — !username', array('!username' => theme('username', $node), '!date' => format_date($node->created)));
endif;

print $content
if ($taxonomy):
print $terms

endif;

if ($links):

endif;

Please help how to edit it.

ackologic’s picture

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.

brittalpana’s picture

Thanks - ackologic, its really working. I also use the "

" after my post then it appear full post.