How do I remove teasers?

register - November 7, 2004 - 10:32

Hi,

I want to start a collaborative book and I want each book page added to the front page of the website when submitted. However, I only want the title of the book page, without any teasers or page contents. I know this is possible using the flexinode, but I'd prefer using the book module; mostly because I don't know how to create a drop-down box in the flexinode creation page that will allow users to include the page into a book at the time of submission (Although they can do it afterwards, I'd prefer the option to do it at the time of creation.)

Thus, my question is how can I remove all book page content from the front page at the time of submission?

Thanks!

Flexinode okay

register - November 7, 2004 - 12:03

If I could figure out how to add a flexinode submission into a book at the time of creation, then that would be okay as well. Is this possible?

You could always edit the boo

Lineman@lineman.net - November 7, 2004 - 14:42

You could always edit the book module so that it appends <!--break--> to the start of all submitted content.

Hmmm

register - November 7, 2004 - 15:23

I tried appending <!--break--> to the beginning of a submission and it wouldn't work that way. If I can figure out where it should go in the book.module then I'll give it a try.

Thanks!

I tried but couldn't make it work

register - November 7, 2004 - 16:27

I tried guessing and it didn't work.

Removing teaser

nevets - November 8, 2004 - 02:32

By modify book_content I think the following does the job

Replace

    // Extract the page body.
  $node = node_prepare($node, $teaser);

with

  // Extract the page body.
  if ( $teaser )
  {
    $node->body = "";
    $node = node_prepare($node, FALSE);
  }
  else
  {
    $node = node_prepare($node, $teaser);
  }

You could add another setting to the book module, say book_show_teaser, default to yes then change the if statement to

  if ( $teaser && variable_get("book_show_teaser", TRUE) )

this way the site administrator can chose to show teasers or not.

Hmm...that didn't seem to work.

register - November 8, 2004 - 16:23

I'm not sure what I'm doing wrong, but that didn't work. The teaser is still showing on the front page.

Why couldn't you just do this?

register - November 8, 2004 - 16:33

// Extract the page body.
$node = node_prepare($node);

Could you just leave the teaser out altogether? I'm not much of a programmer, but this makes sense to me. Of course I could just try it and see, but I'd likely mess something else up unknowingly... ;-)

Update: I tried it and it doesn't work either.

Perhaps it is working?

register - November 8, 2004 - 17:24

Maybe it is removing the teaser and showing the entire post? The problem with this is that I don't want anything on the front page except the title of the post. I haven't tested it yet, but my guess is that's what happened.

excerpt.module

kps - November 8, 2004 - 15:50

You could use excerpt.module to make teasers independently editable; I'm pretty sure they can be blank.

The only thing is, I don't even want a field

register - November 8, 2004 - 16:27

Does it have an option for excluding the teaser field altogether? I don't even want it available, because someone will surely use it if it is.

Try this

kps - November 11, 2004 - 23:30

No, excerpt.module always provides a box for a custom teaser.

Try this: ... okay, no attachments here ... well, save the following as 'noteaser.module' in your modules directory, enable at admin/modules, configure at admin/settings/noteaser ; as-is, no warranty, no support (well, no free support), blah blah blah...

<code>
<?php
// $Id: noteaser.module,v 1.1 2004/11/11 23:19:22 kevin Exp $

function noteaser_help($section) {
  switch (
$section) {
    case
'admin/modules#description':
     
$out = t('Suppress teasers.');
    case
'admin/settings/noteaser':
     
$out = t('Settings for suppressing teasers.');
      break;
    default:
     
$out = '';
      break;
  }
  return
$out;
}

function
noteaser_settings() {
 
$header = array(t('node type'), t('show teaser'));
  foreach (
node_list() as $type) {
   
$node = new StdClass();
   
$node->type = $type;
   
$rows[] = array(
     
node_invoke($node, 'node_name'),
     
form_checkbox('', "noteaser_show_$type", 1,
                   
variable_get("noteaser_show_$type", 1)),
    );
  }
  return
theme('table', $header, $rows);
}

function
noteaser_nodeapi(&$node, $op, $arg) {
  switch (
$op) {
    case
'load':
      if (
variable_get("noteaser_show_$node->type", 1) == 0) {
       
$node->teaser = '';
      }
      break;
  }
  return
NULL;
}

?>

Works fine

eltweako - November 12, 2004 - 09:22

Thanks for the code.
I was already looking for something like this ......

Thank you!

register - November 14, 2004 - 07:48

It works great!

Teaser

echos - January 24, 2005 - 02:39

This does not seem to work on 4.5.2. I ahve been trying to get a page on the front page for awhile. All I get is the teasers from each entry. I have set teaser to unlimited, I have installed noteaser.module and I ahve tryied the flexinode module. My front page stll shows only teaser of entries.

 
 

Drupal is a registered trademark of Dries Buytaert.