In node.module a function called node_configure() sets the number of teasers I can view on a page:
'#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25))
I want to view 300.
I don't want to use views.
I don't want to just add '300' to the array.
I thought the solution would be to tweak the form in template.php:
function phptemplate_node_configure($form){
$form['default_nodes_main']['#options'] = drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 300));
return drupal_render($form);
}
But it doesn't work. If I choose 300 on the form, I get an error.
So how do you configure the number of teasers without hacking core?
Comments
Comment #1
dave reidUse views?
Comment #2
MauMauI use views very often and I like it very much.
This project, however, will have to use node.module to display teasers.
My solution was to make a new module:
It looks like it's working.
Comment #3
Gurpartap Singh commentedYou could simply add the 300 option using hook_form_alter() and it wouldn't produce the validation error as you might have encountered with the template.php hack.
Comment #4
Anonymous (not verified) commentedThe hook_form_alter is the correct way to do this.
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.