By p6 on
Just set the teaser length as 200 characters @ /admin/post-settings
Looks like it's not being implemented. Content being displayed on the front page continue to be full nodes rather than 200 char teasers.
Whats gone haywire ?
Just set the teaser length as 200 characters @ /admin/post-settings
Looks like it's not being implemented. Content being displayed on the front page continue to be full nodes rather than 200 char teasers.
Whats gone haywire ?
Comments
Recreate the Teaser Cache
The generated teaser text is saved in a cache, you need to go and edit the node again, submit it and then the new length should be shown.
The node module also attempts to break the text on a paragraph or sentence boundary, so this will also affect the final length.
Same problem
I have exactly the same problem with all the (imported) nodes on my site.
Editing the posts individually then saving it does work, thanks 4wding.
I guess I'll need to dig a bit deeper to find a quicker way to update all the posts simultaneously.
try the update.php script
Another way to flush the cache is to execute the database update script on your site:
http://yoursite.com/update.php
Do this when you are logged in as admin, and you will be asked if you want to perform the update. Usually nothing needs to be done, but the script will still empty all your cache data.
This should definitely be quicker for you :)
update.php did not resolve caching
Thanks 4wding, I did try that but update.php did not resolve caching so maybe the cache was not the problem.
I've fixed up all the most popular posts, the rest can just be two-liners for now....
The posts were all imported using Steve's Wordpress to Drupal Conversion tool. I ran it under Linux which is completely untested... until now. So I wouldn't be surprised if that is where the problem lies. No-one but myself to blame :)
Although I should add that the above tool saved me heaps of work so a couple of little glitches are not a problem.
cheers
ruben
Perhaps its not the cache
Thinking about it a little more, perhaps the node stores this in a different place than the main Drupal cache. I don't know too much about this area unfortunately.
You could try importing everything from Wordpress again with the new limit set ;) I'm guess that is a little too much work though.
At least you have things mostly working now.
Teaser is a separate field
Firstly, thanks Ruben for your vote of confidence in my conversion program. When converting records from Wordpress to Drupal, if within Wordpress excerpts (teasers) are present then the excerpts are considered teasers and accordingly added to the teaser field within Drupal. The main body of the post is also added to the 'body' field of Drupal.
If excerpts are not used (or present) within Wordpress then what happens is that the body of the post is added to both the 'teaser' and 'body' fields of Drupal. Yes, they are duplicated.
Within Drupal, if the teaser length setting is not set that implies that the teaser is the entire post (article) which means the entire post (article) is stored in the 'teaser' and 'body' fields (duplicated).
I don't use the automatic teaser length setting (ie 200, 400 etc) as it's too rigid in use. It doesn't account for broken HTML tags, which will cause havoc for your application. I prefer the
<!--break-->tag and purposely position it.I'm not a PHP guru but from the structure of the Drupal 'node_revisions' table the front page (or main page or whatever it's called) the posts are populated from the 'teaser' field. When viewing a single post the information is populated from the 'body' field.
I can't comment on the caching issue but I don't think that is a factor regarding this issue.
___________________________
Steven Taylor
Melbourne, Australia.
http://superjacent.net/cms
You can run this script to
You can run this script to update all teasers on your site...
Thanks Krotty
That's great Krotty, thanks.
I've fixed up my teasers but that script could come in very useful...
... especially for my ongoing explorations into figuring out Drupal.
cheers
- ruben
Problems running script to update teaser lengths
Krotty, this script seems to be just what I need (thank you!) but I'm having trouble running it. I get the error:
Fatal error: Cannot redeclare timer_start() (previously declared in /home/[me]/public_html/includes/bootstrap.inc:116) in /home/[me]/public_html/includes/bootstrap.inc on line 122I am running Drupal 5.1 (haven't updated yet) and my host has PHP 5.2.4 installed. I'm not savvy enough yet to understand the cause -- could it be the PHP version?
Any ideas are welcome!
Just a guess...
It seems that you have added the above code to an existing Drupal page, rather than running the snippet in it's own file. Drupal includes 'bootstrap.inc' automatically before the
include "includes/bootstrap.inc"line is called in the above snippet, hence the redeclaration of the function. Try making a new file ("update_teasers.php" or something) with the above snippet alone, and it should work.To make it work you should
To make it work you should replace the line...
$result = db_query("SELECT nid,body,teaser FROM node");... with this one:
$result = db_query("SELECT nid,body,teaser FROM node_revisions");:]
Szy.
--
Znajkraj
Should be maintenance task?
Thanks, this worked well for me. It seems like this should be apart of the standard maintenance tasks for Drupal's cron run.
Or try the "retease" module
Might become part of core + linked to cron, in due course.
gpk
----
www.alexoria.co.uk
gpk
----
www.alexoria.co.uk
For drupal 5
In Drupal 5, with clean-urls enabled it's "/admin/content/node-settings".
quick and dirty D5
I updated teasers directly via SQL:
UPDATE node_revisions SET teaser = body WHERE vid = vid;This does not trim posts according to preferences set at /admin/content/node-settings but it sets the teaser equal to the full body as if you set teaser length to unlimited on this page.
'(Òvó)
Cool!
Thanks! That solved my problem!
Seems body is in
Seems body is in node_revisions now rather than node as it was 2007.
This snippet is problematic,
This snippet is problematic, because each update writes over the teasers for ALL revisions of a node, not just the current revision. So it's a potential performance hit on sites with many revisions. Further, and more importantly, if the last revision in the SELECT isn't the published revision, the final teaser won't correspond to the published revision (which will happen, for instance, if you are using revisioning for an edit->approve workflow).
At the very least, it should update by vid instead of nid, but ideally it should probably also ignore all unpublished revisions.