0

I'm looking for a module which can allow to add a select list like views customfield provides a text field. The select list are on the based of above fields. Example : I have Edit and delete operations in each views row corresponding to the result.I need these operations in select list. Any module suggestions ?

P.S. : Please don't suggest about views_php.I can write custom handlers instead of this module.

0

This is very easy to achieve but does not do much on it's own :

  • Create a new field for something like Content:NID
  • Go to Theme Information in the view settings
  • Find the template fie name suggested for your field
  • Create that file in your theme folder eg views-view-field--my-view--page--title.tpl.php
  • Press rescan templates in theme information (file name will go bold)
  • Add the following to the file
<select name="ops_<?php print $row->nid; ?>">
  <option value="edit">edit</option>
  <option value="delete">delete</option>
</select>

It doesn't do anything on it's own, you could wrap it in a <form> and specify a path as your method to process it, or use jQuery to do something.

But ... There is also an excellent module called View Bulk Operations (VBO) which will probably give you all the functionality you need.

| improve this answer | |
  • Thanks for the answer.Rewrite the field output will not allow adding html.It will simply print the result. – Naveen Valecha Nov 14 '14 at 10:15
  • You're right, I forgot that, I have changed my input formats, I've updated it to use templates. – jowan sebastian Nov 14 '14 at 11:56
  • Yeah templates is the way to do so.Also writing the custom handler is awesome.I have achieved it by writing the custom handler. But I'm looking for some contrib module stuff. – Naveen Valecha Nov 14 '14 at 12:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.