I can't get rid of the Flag-weight fields

drupalina - October 15, 2009 - 18:30
Project:DraggableViews
Version:6.x-3.3-beta2
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi,
I've just installed Draggable-Views along with Flag-Weights and Flag modules, in order to handle "My bookmarks" for the users.
Then I changed the default My_bookmarks view. The table is draggable alright. But the Weight field is still being displayed in the table. I edited the "Flag:Weight" field and checked the "Exclude from display", but it is still showing up in the table. I want my users to see only the draggable crosses and no "weight" numbers (because it's pretty useless to them).

#1

sevi - October 15, 2009 - 21:50

Drag'n'drop will not be possible work if the Weight field is "excluded from display" (it must be available for javascript).
I can't imagine your situation. Please post the export code of your view.
(A guess: Do you use the fields DraggableViews: Order in combination with Native handler too?)

#2

drupalina - October 15, 2009 - 23:57

This is just a slightly modified version of the default "My bookmarks" view that comes with the Flag module.
here's the export code:

$view = new view;
$view->name = 'flag_bookmarks';
$view->description = 'A page listing the current user\'s bookmarks at /bookmarks.';
$view->tag = 'flag';
$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('relationships', array(
  'flag_content_rel' => array(
    'label' => 'bookmarks',
    'required' => 1,
    'flag' => 'bookmarks',
    'user_scope' => 'current',
    'id' => 'flag_content_rel',
    'table' => 'node',
    'field' => 'flag_content_rel',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('fields', array(
  'value0' => array(
    'label' => 'Order',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'exclude' => 0,
    'id' => 'value0',
    'table' => 'draggableviews_structure_node0',
    'field' => 'value0',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'type' => array(
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'label' => 'Type',
  ),
  'title' => array(
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'label' => 'Title',
    'link_to_node' => 1,
  ),
  'name' => array(
    'label' => 'Author',
    'link_to_user' => 1,
    'id' => 'name',
    'table' => 'users',
    'field' => 'name',
  ),
  'comment_count' => array(
    'id' => 'comment_count',
    'table' => 'node_comment_statistics',
    'field' => 'comment_count',
    'label' => 'Replies',
  ),
  'last_comment_timestamp' => array(
    'id' => 'last_comment_timestamp',
    'table' => 'node_comment_statistics',
    'field' => 'last_comment_timestamp',
    'label' => 'Last Post',
  ),
  'ops' => array(
    'label' => 'Ops',
    'id' => 'ops',
    'table' => 'flag_content',
    'field' => 'ops',
    'relationship' => 'flag_content_rel',
  ),
));
$handler->override_option('sorts', array(
  'value0' => array(
    'order' => 'ASC',
    'id' => 'value0',
    'table' => 'draggableviews_structure_node0',
    'field' => 'value0',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'status' => array(
    'operator' => '=',
    'value' => 1,
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'role',
  'role' => array(
    '2' => '2',
  ),
  'perm' => '',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('title', 'My bookmarks');
$handler->override_option('empty', 'You have not yet bookmarked any content. Click the "Bookmark this" link when viewing a piece of content to add it to this list.');
$handler->override_option('items_per_page', '25');
$handler->override_option('use_pager', TRUE);
$handler->override_option('style_plugin', 'draggabletable');
$handler->override_option('style_options', array(
  'override' => 1,
  'sticky' => 0,
  'order' => 'asc',
  'columns' => array(
    'value0' => 'value0',
    'type' => 'type',
    'title' => 'title',
    'name' => 'name',
    'comment_count' => 'comment_count',
    'last_comment_timestamp' => 'last_comment_timestamp',
    'ops' => 'ops',
  ),
  'info' => array(
    'value0' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'type' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'title' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'name' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'comment_count' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'last_comment_timestamp' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'ops' => array(
      'separator' => '',
    ),
  ),
  'default' => '-1',
  'tabledrag_hierarchy' => array(
    'field' => 'none',
    'handler' => 'native',
  ),
  'tabledrag_order' => array(
    'field' => 'value0',
    'handler' => 'native',
  ),
  'draggableviews_extensions' => array(
    'extension_top' => '3',
    'extension_bottom' => '3',
  ),
  'tabledrag_order_visible' => array(
    'visible' => 'visible',
  ),
  'tabledrag_hierarchy_visible' => array(
    'visible' => 0,
  ),
  'draggableviews_depth_limit' => '-1',
  'draggableviews_repair' => array(
    'repair' => 'repair',
  ),
  'tabledrag_types_add' => 'Add type',
  'tabledrag_expand' => array(
    'expand_links' => 'expand_links',
    'collapsed' => 0,
    'by_uid' => 0,
  ),
  'tabledrag_lock' => array(
    'lock' => 0,
  ),
  'draggableviews_default_on_top' => '1',
  'draggableviews_arguments' => array(
    'use_args' => 0,
  ),
));
$handler = $view->new_display('page', 'Page', 'page');
$handler->override_option('path', 'bookmarks');
$handler->override_option('menu', array(
  'type' => 'normal',
  'title' => 'My bookmarks',
  'description' => '',
  'weight' => '0',
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => NULL,
  'description' => '',
  'weight' => NULL,
));

#3

sevi - October 16, 2009 - 06:48

You've set

...
  'tabledrag_order_visible' => array(
    'visible' => 'visible',
  ),
...
.

You might set uncheck this options to achieve the desired appearance :) (see screenshot)

Greetings,
sevi

AttachmentSize
Bildschirmfoto 2009-10-16 um 08.47.59.png 58.25 KB

#4

drupalina - October 16, 2009 - 14:40

Hi Sevi,
Thanks for your elaborate help!!!, especially the screenshot. But, I kept getting the same weight boxes whether I uncheck "Show input field" or not.
But after I unckeched it, I also moved the Draggable Views field to the very bottom, and then it worked!!!
MANY MANY thanks!!!
Great module and a very important one! Thanks!

(now I need to find a way to display these bookmarks more like short teasers. But that's another issue)

#5

sevi - October 16, 2009 - 15:32

Having the DraggableViews-handled field on the first place should not be possible. An error message should have been produced:
"# Display "Defaults": Draggableviews: The drag-handles will be attached to the first field. But the currently configured first field will not be shown. Move the currently configured first field to another position or choose Show input fields? on the settings page."

..I think this message summarizes all this issue is about :)
Have you seen this message (I'm asking just to be sure that there's no bug..)

Retrospective: What would you change in the UI (e.g. help messages,..) to make this stuff more intuitive?

Greetings,
sevi

#6

drupalina - October 17, 2009 - 14:32

Hi Sevi,

Yes, I saw that message and that's how I eventually found a solution. But I didn't see that message immediately - probably something to do with the delay in Views module. I think if there were examples about how to use DV in different views scenarios in README.txt, it would help a lot.

About the UI: The first thing that I'd love to see is no "Save" button. The end-users should be able to just drag that stuff around and the changes should be saved instantly. If I, the admin, often forget to click the save button in long lists, then I can imagine that the end-users will do so pretty often too. Judging from webstandards and expectations today, this is what the current users expect. It would also be great if such save-in-place functionality also extended throughout Drupal 6.x especially that they are making a lot of use of those draggable crosses in 6.x admin.

The 2nd thing is to allow for that small alt="Drag to re-order" message to be customizable by admins. For example, because the "Save" button is not that obvious, other admins mihdt like to say "Simply drag to reorder and then click the "Save" button"

3rd -- Also "Save" button should rather say "Save this order"

The 4th (and a very important) thing is to allow for Draggable Teasers , because teasers can be themed, and themed differently depending on content type. And then above each teaser there can be a little pane where the cursor changes to a draggable cross. Because end-users scroll and move the mouse they will instantly notice the cursor changing when it mouseovers those vertically stacked teaser panes, and that would be much more intuitive, then having a little un-obvious cross in the corner of a table. Also tables are not always great for listing and making sense of a lot of content.

The 5th thing is to allow for an option to have the cursor change to a draggable cross throughout the entire area of the table (except where the links are) . I think this can be done with a simple CSS display="block"

Hope these help.

Best wishes

#7

sevi - October 20, 2009 - 05:43

Good points,
many thanks for taking time to analyse the situation.

I'll keep this issue open and the message in mind.

Greetings,
sevi

 
 

Drupal is a registered trademark of Dries Buytaert.