I recently download and installed the Teaser by Content Type module but unsure how it works. I basically want the content on a webpage to get cut-off after a certain amount of characters which then has a link that goes to the full length of the document. Is this the right module? Does anyone know of a better or explain how to use this one? I went to the post setting in the Node but not sure what I have to do to get these feature usable. Any help would be most appreciated.

Comments

cabplan’s picture

any help would be helpful

gpk’s picture

>I went to the post setting in the Node
That's the right place for setting the global default number of characters for the cut-off.

Teaser by Content Type lets you specify a different cut-off length for different content types.

cabplan’s picture

Issues are that I have pages with content in them already so I do I get those to shrink to the number of characters I set. I even tried to copy out the text and place it back it but that is not working either. any help would be appreciated.

gpk’s picture

As the Teaser by content type module project says you need to re-save nodes to get the teasers to be re-generated with any new settings. To do this you need something like Retease or Views Bulk Operaitions. Copying and pasting back the node body should work, if it doesn't then it looks like you are counting characters differently from Drupal or somesuch.

cabplan’s picture

The pages are still not cutting off at the set number of characters set. I have applied the retease module and set the Node post settings to 400 characters and set the retease but the old pages that has 1200 characters still displays all 1200 characters and is not cutting off. Please help.

gpk’s picture

OK the thing is to get the new teaser length to be applied to a single node, which should happen just by editing a node and hitting Save. retease won't help if we can't even get this to work! On a dev instance of your site I'd try disabling the teaser by content type module and see if the general teaser length setting from the nodepost settings page gets respected when changed. Then I'd try applying a new teaser length to a specific content type. It could be that perhaps another module is interfering with teaser by content type, or that the latter is interfering with the setting on the post settings page.

cabplan’s picture

Ok so I turned off both my Teaser by Content module and my CCK Teaser field module, then I went to Nodes-->Post Settings to make sure the 400 characters were set, I then went into my page that has 1200 characters added a word at the end and saved but all the content still shows up. Am I missing a step? or completely doing this wrong? I want it to cut off after 400 words and add a link at the end of the teaser to go to the complete document.

gpk’s picture

Aha, think I've been missing something that should have been obvious to me.

The teaser length setting only applies when viewing nodes in "teaser mode", typically when viewing a number of nodes together on some sort of listing page, a bit like the front page of this site.

When you view a node on its own on a page (i.e. node/xxx) then you get the full node. Do you want to get just the teaser when at URL node/xxx ?

cabplan’s picture

Hi gpk, Yes I would just like to get the teaser when you come to that particular node/xxx , but also want there to be a hyperlink that goes to the full node, is that generated automatically or do I have to manually put in a hyperlink?

gpk’s picture

OK this is non-standard behavior.. to avoid having to do it with a custom module which would need to intercept the node building/themeing and automatically output a link e.g. node/xxx/full and then define a new menu item node/%node/full and associated callback ... you might be able to do all this with Views. Views will happily override existing menu items, so you need to define 2 views that use arguments ... node/% and node/%/full ... the argument being the node nid. These will return just the one node, and you can control the amount of text shown by customising the field settings (you can probably do away completely with teaser by content type). You can then tell Views to output a "more" link of some sort to link to the full node.

cabplan’s picture

Is there any video that can guide me through this process, I am a little confused on how to do this.

Found a video here:
http://gotdrupal.com/videos/drupal-views-tutorial

cabplan’s picture

Hi gpk, ok I think I this Views module will work but not really sure how to set this up. So my first step was go into Views then Add a new View (short). In my Default screen I set More Link to Yes and Fields to Node:Body. After doing this I preview the display and I get all the different Body content from all the pages. I then add the Argument Node: Nid but that does not change the list at all. When I try to put % in the Argument field in the Display it does not let me. Do I need to create a Page Display withing my View besides the Default. I believe this will work but current it is showing all my Bodies of each one of my Nodes. Also even after I indicated to create a "More" link it does not display in the preview below the text. Any help would be most appreciated.

gpk’s picture

Yes you need to create a Page display and the path will be just node (I think the % - argument - bit will be handled automatically on that one).

To test out the argument, in the Preview, insert a node id in the Arguments box.

You will need to set up another page display to handle node/%/full ... and that will be the path to enter for it.

cabplan’s picture

gpk, I really appreciate the time your are giving me. Ok I have set up to page display under my default. Let me explain what I am seeing and my setting so you can tell me what I am doing wrong because for my preview for both I am see all the body content for all the nodes as opposed to just seeing one node. Should I be seeing all the body content of the nodes for all the node? So I have a "short" View I created. In there I have the default view settings as: Basic Settings - More Link: Yes, Arguments - Node:Nid and Fields - Node: Body Body then below live preview I have nothing in the Arguments field. I do not know what this field is for. Ok for my first Page display: my path is: node and changed the Fields - Node: Body Body to Trim at 800 characters, everything else seem to carry over from the Default view. Then I created another Page view and name the path: node%full then I changed the Field - Node: Body Body to take off the Trim character check box but then it seems to also change the first Page view when I go back to this. Do I need to create a completely separate View for my full view node. Also even when I do this, like I mentioned above, it lists all the body content for all of the nodes not just for one so what step I am missing to implement this. Also even though I indicated to add a More link it does not appear in the preview, is it suppose to? I really appreciate you helping me out with all this. You are like Mr. Drupal.

gpk’s picture

You might well want to read an online Views tutorial, or get the Using Drupal book (O'Reilly), or read the built-in Views documentation (you need the Advanced Help module for this).

Meanwhile, the Arguments field in the live preview is for testing the behaviour with specific argument(s). If no argument is specified then by default you will get all nodes. If you type a node id in the argument field then that should restrict the view to the node in question. By setting the path for the page display to "node", then when you visit example.com/node/34 the View/display should be invoked (overriding the default response for node/34) and 34 should be passed to the View as the argument. If it doesn't seem to work you might want to try node/% as the path for the page display.

When you set up a 2nd display and want different settings for some parts you need to Override the default settings - there is a button that appears to let you do this when appropriate. This is described in the "advanced help". This display needs to have path node/%/full not node%full.

HTH!

cabplan’s picture

hi gpk, well i watch some videos and followed your instructions but still stuck. So I completely deleted my old View and started from scratch. I created the default view and two page displays, when I created my first display I did an override of the default so it would Trim the Body to 800 characters but everytime I preview a specific node (node/12) it still displays the whole node. Only if I change the default to Trim the Body to a limit is when the rest of the Displays will show the correct result. But when I try to create another Display for the Full it shows the Trimmed body so I am a little confused on why this is happening if I am overriding the default. Any help would be appreciated. Also when I go to the URL (myURL/node/12) it shows the complete Body and not the Trimmed body, how to I apply the new View to my already created Page?

cabplan’s picture

Ok after much searching, I found a module called Paging which helps me set up what I need. Not sure if you know anything about this module but I need help on changing the numbering of pages to just say "Read More" I have checked the check box that said add a Read More link but it just gives me numbers any idea on how to change this?

gpk’s picture

Sorry not familiar with that one... Maybe ask as support request in the project's issue queue? Or search here... Glad you found a way forward anyway.