I've created a custom file for a google-maps that uses javascript, php, and SQL statements. Instead of building a module, is it possible to just simply create a frame for page--front.tpl.php to display my file for the google map?

有帮助吗?

解决方案

Basic implementation of the iframe would be:

<iframe src="/map_script.php" width="300" height="300"></iframe>

Where map_script.php would be your custom map file and you would place it in the root of your website.

If you didn't want the file in the root of your website but in your theme instead it would be:

<iframe src="/sites/all/themes/theme_name/map_script.php" width="300" height="300"></iframe>

Changing the path to suit your site's file structure and theme name.

Of course you can change the width and height or play around with any of the iframe attributes. For more information on what you can do with the iframe tag see https://developer.mozilla.org/en/docs/Web/HTML/Element/iframe

You can put that iframe tag wherever you want the map to print in your page--front.tpl.php file.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top