Hi,

I have a small PHP test application that shows a form and on submit stores the data to a table. This is a test application that works standalone using the same database used by Drupal.

I need to add a menu link which when clicked should show this test application within Drupal theme in the center content area.

One way I thought would be to add a dummy content and add it to the menu and then make custom theme page for this node containing my test PHP application, is this the right way?

Thanks,
Sree

Comments

lyricnz’s picture

Since this is "function" rather than "form", I'd suggest doing it in a module, rather than in the theme. Add a entry to the menu that points to a page generated by your module, and make that module emit the iframe HTML. This is easier than it sounds, maybe 10 lines of PHP.

schogini’s picture

Thanks, that works exactly how I needed it :)

Best,
Sree

netron’s picture

since its a single form, an even easier way is to use the CCK module to create custom field types for a custom content type.

admin/content/types : add content type

input the name and machine-readable "type" name , next on the next page you'll be able to start adding fields to your content type.

once you've saved your content type, you can access the form for that content type via "Create Content"

or more directly by going to

node/add/your_content_type_machine_readable_name

(e.g. if you called it "widget" : node/add/widget)

schogini’s picture

Thanks for the replies, CCK is not working for me since I need more control over the form/application.

I have tried which is working for me, ie.

Copied page.tpl.php" file as "page-node-43.tpl.php" eg: for node 43 which has a link in the menu

Remarked the print $content; and included my php application instead and it works the and I have access to the db_abstraction calls etc.

I will try the module method.

Thanks,
Sree