Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi
I made ajax pager for forum threads in views working with advanced forum, here's the exported view, maybe someone will find it useful.
$view = new view;
$view->name = 'forumcomments';
$view->description = 'forum comments';
$view->tag = 'forum';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
'comment' => array(
'id' => 'comment',
'table' => 'comments',
'field' => 'comment',
),
'subject' => array(
'id' => 'subject',
'table' => 'comments',
'field' => 'subject',
),
'delete_comment' => array(
'label' => 'Delete link',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'text' => '',
'exclude' => 0,
'id' => 'delete_comment',
'table' => 'comments',
'field' => 'delete_comment',
'relationship' => 'none',
),
'edit_comment' => array(
'id' => 'edit_comment',
'table' => 'comments',
'field' => 'edit_comment',
),
'replyto_comment' => array(
'id' => 'replyto_comment',
'table' => 'comments',
'field' => 'replyto_comment',
),
));
$handler->override_option('arguments', array(
'nid' => array(
'default_action' => 'ignore',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'Wszystkie',
'title' => '',
'breadcrumb' => '',
'default_argument_type' => 'fixed',
'default_argument' => '',
'validate_type' => 'none',
'validate_fail' => 'not found',
'break_phrase' => 0,
'not' => 0,
'id' => 'nid',
'table' => 'node',
'field' => 'nid',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
'3' => 0,
'6' => 0,
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_image_size' => '_original',
'default_argument_fixed' => '',
'default_argument_user' => 0,
'default_argument_php' => '',
'image_size' => array(
'_original' => '_original',
'thumbnail' => 'thumbnail',
'preview' => 'preview',
),
'validate_argument_node_type' => array(
'classified' => 0,
'forum' => 0,
'image' => 0,
'poll' => 0,
'panel' => 0,
'firma' => 0,
'news' => 0,
'page' => 0,
'plik' => 0,
'profile' => 0,
'story' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'11' => 0,
'6' => 0,
'1' => 0,
'10' => 0,
'2' => 0,
'3' => 0,
'5' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_php' => '',
),
));
$handler->override_option('filters', array(
'type' => array(
'operator' => 'in',
'value' => array(
'forum' => 'forum',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('use_ajax', TRUE);
$handler->override_option('items_per_page', 1);
$handler->override_option('use_pager', '0');
$handler->override_option('distinct', 1);
$handler->override_option('row_plugin', 'node');
$handler->override_option('row_options', array(
'relationship' => 'none',
'build_mode' => 'full',
'links' => 1,
'comments' => 1,
));
Comments
Comment #1
v8powerage CreditAttribution: v8powerage commented