4

I have altered #autocomplate_path for node queue autocomplete node suggestions to show image field along with title and nid, which is working fine. The code which is returns the image with title and nid is.

$matches[$node->nid] = theme('image_style', array('style_name' => $get_image_field_style, 'path' => $image_field_uri, 'attributes' => array('class' => array('nodequeue-runsheets-images'))))
              . check_plain($node->title)
              . " [nid: $id]";

This is how I see the results with the above working code: -enter image description here

The problem comes when drupal autocomplete pull the selected suggestions and populate it to autocomplete textfield. I see the html tags as . How can I override this to show only node title and mid.

The problem:

enter image description here

2

The solution in following post worked for me http://www.derreklemar.net/tutorial/drupal-autocomplete-overriding-default-select-event-behavior

  • Too bad the link is now dead. However, the actual question gave me the direction I needed. I simply wasn't sure on how to mix in HTML into the autocomplete results. Now, I know! Thanks! – Gor Mar 22 '15 at 13:06

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.