Hi,
How can I show drupal form (return value of drupal_get_form) in iframe?
When I use iframe tag and give form link as source, it show all the screen in iframe.
I want to show just form in iframe.

Regards,
Hakob

Comments

jaypan’s picture

Create a page that only has that form and nothing else. Show it in the iframe.

Contact me to contract me for D7 -> D10/11 migrations.

hakob-7’s picture

I create page with form and return
drupal_render(drupal_get_form('some_form')), but in iframe I get all page, not only form.

jaypan’s picture

Try this (no guarantees the will work since it won't be rendered in a valid HTML page):

die(drupal_render(drupal_get_form('some_form')));

Contact me to contract me for D7 -> D10/11 migrations.

hakob-7’s picture

Thanks, it take an effect, but in form I have table and I get table without drupal standart themes and without jQuery.

jaypan’s picture

That's because you are rendering it without a theme by using die().

You've now seen your two options (fully themed page, or no theme at all), so you'll have to pick one.

Contact me to contract me for D7 -> D10/11 migrations.

hakob-7’s picture

I need jQuery and standart css's there to get sortable table with page navigation and check-all class

jaypan’s picture

Then you're going to have to go with your original code which showed the form in the themed page.

Contact me to contract me for D7 -> D10/11 migrations.

hakob-7’s picture

Is there a way to add jQuery, CSS which are needed for correct work drupal themed table?

jaypan’s picture

Yes - you render the table in the theme.

Contact me to contract me for D7 -> D10/11 migrations.

hakob-7’s picture

How can I do that?:)

jaypan’s picture

You were already doing it here:

I create page with form and return
drupal_render(drupal_get_form('some_form')), but in iframe I get all page, not only form.

Contact me to contract me for D7 -> D10/11 migrations.

hakob-7’s picture

thanks