I am trying to add a node creation form in the header of a view with the following code using the Views PHP module:

<?php

  if (!function_exists('node_add')) {
    module_load_include('inc', 'node', 'node.pages');
    module_load_include('inc', 'media', 'includes/media.pages');
  }

  print drupal_render(node_add('talent_image'));

?>

The form comes up but the "Select media" button is shown as a link and it has a "Remove media" button beside it with a text box below it with the value 0. Clicking any of these does nothing. I want to know which include files I need to include for this to work like how it would on the node creation page.

Comments

Chris Matthews’s picture

Version: 7.x-1.4 » 7.x-1.x-dev
Status: Active » Closed (outdated)

Closing this issue as outdated. However, if you think this issue is still important, please let us know and we will gladly re-open it for review.
sincerely,
- the Drupal Media Team