문제

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