Example view file
DamienMcKenna - April 15, 2009 - 01:00
| Project: | Views Tagadelic |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Jump to:
Description
This module should come with a sample view out of the box, I've tried to build a simple one and am already getting SQL errors.

#1
Some documentation attached. I got it working, but also had to search.
$view = new view;$view->name = 'cumulus';
$view->description = 'Try to get my own weighted tag cloud for Cumulus';
$view->tag = 'tagcloud';
$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('filters', array(
'nid' => array(
'operator' => '=',
'value' => '',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'nid',
'table' => 'node_access',
'field' => 'nid',
'relationship' => 'none',
),
'vid' => array(
'operator' => 'in',
'value' => array(
'7' => '7',
'6' => '6',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'vid',
'table' => 'term_data',
'field' => 'vid',
'relationship' => 'none',
),
'tid' => array(
'operator' => 'not',
'value' => array(
'57' => '57',
'60' => '60',
'59' => '59',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'type' => 'select',
'limit' => TRUE,
'vid' => '7',
'id' => 'tid',
'table' => 'term_node',
'field' => 'tid',
'hierarchy' => 1,
'relationship' => 'none',
'reduce_duplicates' => 0,
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('style_plugin', 'tagadelic_views');
$handler->override_option('style_options', array(
'steps' => '6',
'size' => '500',
'vocab' => 'Labels, Onderwerp',
));
#2
Thanks KoCo. Would you make this into a patch so the view is installed on the module install? I know the taxonomy module does this if you need an example.
#3
I'll try to look into it.
However, there is a little snag.
You've got to have a vocabulary to call by name.
Koen