If I create a field taglist using a view (fields >> view >> viewname) I can only embed the first field of the view. If the desired field is a computed field that is not stored in the database, you can not use this field within the view :(, thus you can not define a taglist for this field thus you can not define a linodef button for this field :(

With views based on nodes you always select nodes. That will be the first part of the linodef tag to embed. Nodes have fields and you are able to add any field to embed as second part of the linodef tag, i.e. you should be able to use any field in a linodef taglist definition.

I would also like to use the view layout in the pop-up window and not a title list. My usage: select images using a view and the title list is not self explanatory

Comments

Pepe Roni’s picture

Furthermore, if I select the second value of a field, it should automatically embed the correct contentvalue option!

What I mean: I have a node with multiple images, a view for these images and computed fields related to these images. The computed fields are not stored in the database. If I select any image in the view, I would like to get the same field value (occurrence) for the computed field to be embedded, i.e. if I select image[3] of node #123, I expect [#123:mycompfield:3] to be embedded.

Is that possible?

Roi Danton’s picture

Nodes have fields and you are able to add any field to embed as second part of the linodef tag, i.e. you should be able to use any field in a linodef taglist definition.

So you mean independently from the selected fields in the view the admin should be able to add every field attached to this node to a taglist. This needs some rework in the admin interface as well as in the view load function but it should be possible at all.

I would also like to use the view layout in the pop-up window and not a title list. My usage: select images using a view and the title list is not self explanatory

I'd like it that way, too. Using the themed view output is one of the further goals for Linodef taglists. This is not as easy as it seems since every view element has to be altered with the javascript link that adds the tag to the textfield. I haven't found the appropriate function in the views api yet to alter each element while retaining the view object.

if I select the second value of a field, it should automatically embed the correct contentvalue option

This depends on the way the view is altered.

Conclusion: Additional options should be added to the taglist creation source step when embedding nodes/fields:
[] Automatically select the first field (as it is now). This allows different node types (with the same field) in one taglist.
[] Allow the admin to select a field from all fields of the node(s). It doesn't matter if the field is selected in the view. When several node types are part of the view only those fields that all nodes share are selectable.
[] Use all fields of the view. Then Linodef tries to attach Linodef tags where possible (on fields, node titles etc).

And in certain circumstances (when multiple values of multiple value fields are used) the option contentvalue should be applied automatically.

This sounds like shiploads of work. ;)

Pepe Roni’s picture

This sounds like shiploads of work.

But when I look at the changes from rc1 to rc5 now, I must say: If anyone could handle that, than you! What you have done already is not great work, it is very great work!

Merry Christmas to you and all Drupalers!

Pepe Roni’s picture

@fields:
open the input field for the field name in the taglist editor for content. Use this field name as is or in case of {first field in view} the first field in the view. Only in that case you have to scan that view for the first field, in all other cases you only have to embed the node id (as if no field was chosen) with the content option.

@layout:
I am eager to see the results ;)

@contentvalue:
I can imagine that this might be complicated.

What about this solution: define a view with a rewritten output for nid and use the whole rewritten output as linodef tag. Then I am free in defining my linodef tag (more than with the taglist editor).
In the taglist editor you can add a "freeform" object type, with a view providing the tag list and the field name with the rewritten output (or always the last field of the view).

Here is an example of such a view (I defined an "image" node with "image" field(s)) and attached these image field to story, too. These node types also have a computed field "inline_image_left" that I would like to embed into the content.

You can import this view in admin/build/views/import:

$view = new view;
$view->name = 'linodef_images';
$view->description = 'View to select and embed images with linodef';
$view->tag = 'linodef, bueditor';
$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(
  'field_image_fid' => array(
    'label' => '',
    '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,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 1,
    'empty_zero' => 0,
    'link_to_node' => 1,
    'label_type' => 'none',
    'format' => 'small_default',
    'multiple' => array(
      'group' => 0,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => 0,
    ),
    'exclude' => 0,
    'id' => 'field_image_fid',
    'table' => 'node_data_field_image',
    'field' => 'field_image_fid',
    'relationship' => 'none',
  ),
  'delta' => array(
    'label' => 'Image (field_image) - delta',
    '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,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'set_precision' => FALSE,
    'precision' => 0,
    'decimal' => '.',
    'separator' => ',',
    'prefix' => '',
    'suffix' => '',
    'exclude' => 1,
    'id' => 'delta',
    'table' => 'node_data_field_image',
    'field' => 'delta',
    'relationship' => 'none',
  ),
  'title' => array(
    'label' => 'Title',
    '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,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'exclude' => 1,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
  'nid' => array(
    'label' => 'Nid',
    'alter' => array(
      'alter_text' => 1,
      'text' => '[#[nid]:field_inline_image_left:0[delta] [title]]',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'exclude' => 1,
    'id' => 'nid',
    'table' => 'node',
    'field' => 'nid',
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'status_extra' => array(
    'operator' => '=',
    'value' => '',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status_extra',
    'table' => 'node',
    'field' => 'status_extra',
    'relationship' => 'none',
  ),
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'image' => 'image',
      'story' => 'story',
    ),
    '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('style_plugin', 'list');
$handler->override_option('style_options', array(
  'grouping' => '',
  'type' => 'ul',
));
thommyboy’s picture

Component: Taglists (ex buttons API) » Code (general)

Hi there,
quite some months ago that this issue was opened. May I ask wether there is any progress regarding the views-style-popup vs. a title list?
Wouldn't it be easy to generate a link on every field contained in the view containing the javascript onclick="linodef_wysiwyg_onclick('[#xyz]?
Especially for Image-Nodes it would be really helpful to be able to select the embedded Node by selecting an image instead of a title...
Regards Tom