Adding an iframe to home.php

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
artemisia
Veteran Member
Posts: 59
Joined: 2013-10-01 15:50

Adding an iframe to home.php

Post by artemisia » 2015-02-20 21:14

I would like to add an iframe (for a calendar application) to the home.php page (or any other page within Appgini).
As a trial I added the following code to the top of home.php, but when the page refreshes I see only a 1 second flash where the frame would be, then the rest of the page content displays normally.

Code: Select all

<html>
<body>
	<iframe id="lcmini" src="http://www.xxxxxx.org/uawv-luxcal/lcmini.php"></iframe>
</body>
</html>
Obviously there is code executing that is negating the iframe, but I'm not sure how to either work with that code or circumvent it.
The iframe works correctly when used in a test page outside of appgini.

Any suggestions?

~Bob

kurtmel
Posts: 3
Joined: 2015-02-19 23:18

Re: Adding an iframe to home.php

Post by kurtmel » 2015-03-14 16:22

Have you tried putting it into a DIV tag first?

patsd102
Veteran Member
Posts: 142
Joined: 2013-01-15 19:59

Re: Adding an iframe to home.php

Post by patsd102 » 2015-03-14 20:36

Try adding it to the login page, under where it says <!-- customized splash content here -->
23.17

artemisia
Veteran Member
Posts: 59
Joined: 2013-10-01 15:50

Re: Adding an iframe to home.php

Post by artemisia » 2015-03-19 21:06

@kurtmel: DIV tag produces same result - quick flash then disappears
@patsd102: ditto

Bertv
Veteran Member
Posts: 65
Joined: 2013-12-11 15:59

Re: Adding an iframe to home.php

Post by Bertv » 2015-03-20 09:44

Did you try an other website? This works for me:
iframe_example.png
iframe_example.png (9.49 KiB) Viewed 7137 times
Bert
I am using Appgini 5.75

patsd102
Veteran Member
Posts: 142
Joined: 2013-01-15 19:59

Re: Adding an iframe to home.php

Post by patsd102 » 2015-03-20 22:33

For all pages add the iframe to the header.php file,
Don't know why its not working on the login page,
Can you try another browser?
23.17

User avatar
sandy3269
Posts: 5
Joined: 2014-01-18 06:54
Location: Washington
Contact:

Re: Adding an iframe to home.php

Post by sandy3269 » 2016-07-22 05:13

I don't know if you have found an answer for your issue, but here is how I solved some of my iframe issues so far: Using a separate start page instead of home.php. In the incCommon.php, around line 456, replace index.php with the your new start page. You still will be able too use the Home.php to login, but can have a start page you can modify too your hearts content.

Using the same technique, I have a drop down group called External Applications, which execute and look like the rest of the site. Below is my Calendar application using Luxcal. I have not added passing user credentials too it yet, but it should not be a problem.

<?php

$currDir = dirname(__FILE__);
include("$currDir/defaultLang.php");
include("$currDir/language.php");
include("$currDir/lib.php");

include_once("$currDir/header.php");

/* grant access to the groups 'Admins' and 'Data entry' */
$mi = getMemberInfo();
if(!in_array($mi['group'], array('Admins', 'anonymous', 'Elijahs_Child'))){
echo "Access denied";
exit;
}
/**
* @return bool
*/
function is_session_started()
{
if ( php_sapi_name() !== 'cli' ) {
if ( version_compare(phpversion(), '5.4.0', '>=') ) {
return session_status() === PHP_SESSION_ACTIVE ? TRUE : FALSE;
} else {
return session_id() === '' ? FALSE : TRUE;
}
}
return FALSE;
}


// Example
if ( is_session_started() === FALSE ) {
session_start();
//echo "Started Session.";
}else {
//echo "Session already running.";
}

$_SESSION["lcUser"] = "[email protected]";


$ip=$_SERVER['REMOTE_ADDR'];

if ( substr($ip,0,6) == '10.0.0' )
{
$website = 'http://10.0.0.201';
}
else
{
$website = 'http://XXXXX.thruhere.net';
}
?>
<style>
#luxcal { width:98%; height:740px; margin:20px; border-style:solid; border-width:1px; border-color:grey; }
body {

}
</style>

<iframe id="luxcal" src="<?php echo $website; ?>/luxcal/luxcal430M-calendar/index.php?lc&cP=0&lcUser=[email protected]"></iframe>

If works great, still needs tweaking.........

Post Reply