0

I have a drupal install (latest 7.x version at the time of writing). It is in the root directory of my domain.

In a non drupal sub-directory, called 'member' so at /member, I have 3rd party script which enables my site to have membership functionality.

The script inside of /member is not drupal, although it does connect to the drupal database to write to the users table to enable single sign-on.

I was wondering if it is possible to display a drupal menu (the main navigation) inside the script in /member? I want to be able to alter the menu in drupal and then have those alterations automatically updated in the /member script.

I would certainly appreciate any advise as to whether this is in fact possible, and some advice about how I might get started.

Thanks.

1 Answer 1

0

Yes, it is possible. In your drupal website:

  • Render the main menu block on a custom made (module) page for example /main-menu-external
  • Strip all the sections but the content section, so that no header, footer, ... is rendered, only the menu.
  • With context load a blank theme on the page "main-menu-external"
  • At this point "main-menu-external" will be a blanco page with only the main menu rendered on it AND will use a different theme from the rest of your website so you can configure it for that page only.

In your /members website:

  • Just put an <iframe> with source "yourdrupalwebsite.be/main-menu-external"

Et voila, there is your drupal menu on an external website :)

4
  • Hi there. Thanks for your idea. I have a further question if that's okay. Does using an <iframe> mean that I would be unable to serve pages securely using an SSL? Would this external (from a different script albeit simply from a subdirectory) <iframe> make the EV SSL display a warning?
    – njwrigley
    Commented Feb 10, 2015 at 20:47
  • I don't know that. But I was thinking, maybe you can use the services module and this module: drupal.org/project/services_menu to implement your external menu? Let me know if this works. I will add it as an answer
    – Robin
    Commented Feb 11, 2015 at 7:27
  • Using your context idea above, what do you mean by 'load a blank theme' via context? Sorry, I cannot understand how to achieve this with context. I'm afraid that I might well need some more hand holding!
    – njwrigley
    Commented Feb 11, 2015 at 20:19
  • After some digging, you will have to use function mymodule_custom_theme() { if (arg(0) == 'event2011') { return 'the theme to use for that page'; } } to load a blank theme on the page where your menu is located
    – Robin
    Commented Feb 12, 2015 at 7:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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