<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="home" title="HomePage" href="HomePage.html" />
<link rel="help" title="HowToUseWiki" href="HowToUseWiki.html" />
<link rel="copyright" title="GNU General Public License" href="http://www.gnu.org/copyleft/gpl.html#SEC1" />
<link rel="author" title="The PhpWiki Programming Team" href="http://phpwiki.org/ThePhpWikiProgrammingTeam" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="Content-Language" content="en" />
<meta name="robots" content="noindex,nofollow" />
<meta name="language" content="en" />
<meta name="document-type" content="Public" />
<meta name="document-rating" content="General" />
<meta name="generator" content="PhpWiki" />
<meta name="PHPWIKI_VERSION" content="1.3.14" />

<base href="../" />
<link rel="stylesheet" type="text/css" charset="iso-8859-1" href="phpwiki-printer.css" />
<title>PhpWiki - Help  /  Transclude Plugin</title>
</head>
<body>

<div id="header">
  
<!-- Page title -->
<h1>Help  /  Transclude Plugin</h1>
</div>
<div id="content">



<div class="wikitext"><p class="tightenable top">The <a href="Help/TranscludePlugin" class="interwiki"><span style="white-space: nowrap"><img src="images/interwiki.png" alt="" class="linkicon" border="0" />Help:</span><span class="wikipage">TranscludePlugin</span></a> can be used to embed include whole (external) web
pages within a wiki page.</p>
<h4>Plugin Arguments</h4>
<table class="wiki-dl-table" border="1" cellspacing="0" cellpadding="6"><tr class="tightenable bottom"><th><tt>src</tt></th>
<td>The URL of the page to transclude</td>
</tr>
<tr class="tightenable top"><th><tt>height</tt></th>
<td>The (initial) height of the transclusion frame.
If, possible, after the transcluded page is loaded,
the frame is resized via javascript so that it
fits the entire transcluded page.  (See below for more.)</td>
</tr>
</table>
<h4>Bugs / Caveats</h4>
<ul><li class="tightenable">Pages are transcluded using <tt>&lt;iframe&gt;</tt> tags.  Older browsers do not
support <em>iframe</em>s.  In that case the user will be presented with a
link to the trancluded material.</li>
<li class="tightenable">When possible, <u title="Empty link to: JavaScript" onmouseover="window.status=&quot;Empty link to: JavaScript&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">JavaScript</u> code is used to adjust the height of the
<i>iframe</i> so that it fits the entire transcluded page.
Unfortunately, this seems possible only when the transcluded page
comes from the same server as the wiki page.  (This restriction is
due to security checks built in to the <u title="Empty link to: JavaScript" onmouseover="window.status=&quot;Empty link to: JavaScript&quot;; return true;" onmouseout="window.status='';return true;" class="wikiunknown">JavaScript</u> language.)</li>
<li class="tightenable">The recursion detection code does not currently work.  Be careful to
avoid recursive transclusions, or you'll be sorry (or at least
amused.)</li>
</ul>
<h4>Example</h4>
<pre class="tightenable">
&lt;?plugin Transclude src=&quot;http://phpwiki.sourceforge.net/demo/ChangeLog&quot; ?&gt;</pre>
<p class="tightenable">will get you</p>
<div class="plugin tightenable bottom" id="TranscludePlugin"><p class="transclusion-title">Transcluded from <a href="http://phpwiki.sourceforge.net/demo/ChangeLog" target="" class="namedurl"><span style="white-space: nowrap"><img src="images/http.png" alt="" class="linkicon" border="0" />http://phpwiki.sourceforge.net/demo/ChangeLog</span></a></p>
<script type="text/javascript">
<!--//
function adjust_iframe_height(frame) {
            var content = frame.contentDocument;
            try {
                frame.height = content.height + 2 * frame.marginHeight;
            }
            catch (e) {
              // Can not get content.height unless transcluded doc
              // is from the same server...
              return;
            }
          }

          window.addEventListener("resize", function() {
            f = this.document.body.getElementsByTagName("iframe");
            for (var i = 0; i < f.length; i++)
              adjust_iframe_height(f[i]);
          }, false);
// --></script>
<div><iframe title="Transcluded page" src="http://phpwiki.sourceforge.net/demo/ChangeLog" width="100%" height="450" marginwidth="0" marginheight="0" class="transclude" onload="adjust_iframe_height(this);">
<div class="transclusion"><p>See: <a href="http://phpwiki.sourceforge.net/demo/ChangeLog">http://phpwiki.sourceforge.net/demo/ChangeLog</a></p>
</div>
</iframe></div>
</div>
</div>

<div id="footer">  <hr class="printer" noshade="noshade" />
<p class="editdate">Owner: &quot;admin&quot;  Last edited on August 14, 2007  7:11 am by &quot;The PhpWiki programming team&quot;</p>
</div>

</div>
<!-- Add your Disclaimer here -->
</body>
</html>
