I would like to create a custom drupal menu block loaded with the TNG menu, would this be possible? If so any tips on how to accomplish it?

I have fiddled with this myself with no success. I cannot get it to work from behind the /tng path to keep the pages within the iframe.

Comments

arturoramos’s picture

This is a very tricky issue as any content or url must be "fed" to the IFRAME in which TNG appears.

If you look at the module, you will see how I have achieved this through the use of Javascript. The content is written into a blank page whose content is then fed to the IFRAME. You can achieve what you are trying to do through such a procedure, but I think you may simply be able to feed the iframe the url of the requisite command, i.e. create a menu call to a different function for each command in the TNG menu. A sample function would look like:

function tngintegrate_menu1 () {
  $menu_url = "http://www.yoursite.com/tng/searchform.php";
  $output = '<IFRAME ID="anIframe" NAME="anIframe" SRC="' .$menu_url. '" WIDTH="100%" HEIGHT="800px"';
  $output .= 'hspace=0 vspace=0 marginwidth=0 marginheight=0 frameborder=0 scrolling=auto>';
  $output .= '</IFRAME>';
  ob_end_clean();
  print theme('page', $output);
}

Of course, the person would have to be logged into TNG in order for many of the menu items to work (depending on the TNG persmission) otherwise they would get redirected to the login page.

Let me know if that works.

arturoramos’s picture

Status: Active » Closed (fixed)
johnvp’s picture

Version: 5.x-1.x-dev » 6.x-1.0-beta2
Status: Closed (fixed) » Postponed (maintainer needs more info)

Can you explain more about how "tngintegrate_menu1" is implemented. I can't get it to work, how do I connect the menu entry to running "tngintegrate_menu1"

johnvp’s picture

Category: feature » support
Status: Postponed (maintainer needs more info) » Fixed

I know how to do it now

put this

$items['tng/search'] = array(
'title' => 'TNG Genealogy search',
'access arguments' => array('access TNG'),
'page callback' => 'tngintegrate_menu1',
'type' => MENU_NORMAL_ITEM
);

in function tngintegrate_menu() and it works.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.