I have a Zend web application running next to Drupal 6. The basic structure is like this:
www.domain.com/cms/
www.domain.com/zf/
CMS is Drupal content, and ZF is Zend Framework content.
Here’s the question. I’m looking to place the primary/secondary links from Drupal into the ZF menus so that the pages are relatively seamless as you navigate between the CMS and Zend. Currently there’s an Ajax call being done in Zend to get the primary links from Drupal. This is inefficient and shows up on reports, thus why I’m tasked with fixing it.
Conceptually, what might be the best way to do this? Should I include a file from Drupal in my ZF app, or something else? I have very little knowledge of Drupal, so I’m not sure if I can just do a database call to get the links, or if there’s a function I should be calling.
Id’ say the best way is to export the Drupal menu in some kind of format and then parse it in your ZF application. And to keep it in sync just write a small script that does the export and run it daily or whatever suits your needs (preferably when your site has the lowest traffic, if performance is a priority).
Here is a list of functions related to Drupal menu: Menu system
This is something that will get you started:
But you’d have to bootstrap Drupal, to have access to all the Drupal’s function. So you can do something like this:
And of course you could just do a direct database call, but first you have to see how Drupal gets the menu structure and then just strip out the SQL queries you need.
Good luck!