Topic: Step By Step - How to Embed a forum into your VLD Website
Ok, after much trial and error.... I found a solution that will work for everyone...
This is pretty slick because it allows you to hide the fact you are using <iframes> thanks to a little java code..
I am still using frames on my website, but I have taken away the borders and added transparency, and the code that triggers the onload resize javascript:
Give it a shot and let me know if you like it...
1.) First, view your start page and then right click and select "view source".
2.) Save this as forum.tpl
3.) Open the file up your editor (I use Notepad++). You can use notepad too, but that doesn't give your line numbers, etc.
4.) Remove all of the code starting with <div id="content_wrap">.......and stopping just before the.....<div id="footer_wrap">
5.) Replace it with the following (taking note of what forum folder path you have phpbb2/3, vBulletin, Vanilla..etc.. located on your server):
<iframe width="100%" id="iframe_id" name="iframe_name" src="http://www.mysite.com/forum/" scrolling="no" frameborder="0" ALLOWTRANSPARENCY="true" onload=resize_iframe();></iframe>
I have also included an iframe resize javascript code, that is controlled by the child window.
<script type="text/javascript">
<!--
moz=document.getElementById&&!document.all
mozHeightOffset=20
function resize_iframe(){
document.getElementById("iframe_id").height="" // required for Moz bug, value can be "", null, or integer
document.getElementById('iframe_id').height=window.frames["iframe_name"].document.body.scrollHeight+(moz?mozHeightOffset:0)
}
// -->
</script>
6.) Now upload the forum.tpl to your server into the template folder that you are using (in my case it is dark_yellowish).
7.) Now go into your CP, Content, Manage pages, General, and then "Add page".
8.) Give it a NAME, LABEL, and Custom Template name as: forum (without the .tpl). Don't fill anything in the Page editor box. Now save it!
I have also inserted a link to this page on my header.tpl after:
<div id="headernav">
with the following:
<!-- IF loggedin == "1" -->
<li><a href="{virtual_path}{ifelse:fancy_urls,"1","p/forum/index.html","index.php?m=pages&p=forum"}" title="forum">Forum</a></li>
<!-- ENDIF -->
What a headache this was, but very gratifying working it through.... Thanks to everyone who posted how-to's on this topic...
Hope it helps you all...