Sign Up! Login: Password: New User? Forgot? Support
Code 
 
 
Forums 
Forums : Layout & Theme > Widget in an iFrame
Mottie (SuperAdmin) 6/23/2011 11:56 AM EST : Widget in an iFrame
ACK!
Mottie
Posts: 3883

0
Like

0
Dislike

Widget in an iFrame

GuildPortal admin site link to the original post

This script was written so that if your page is showing in an iframe, it reformats to only show the desired content. Essentially it was written so that an alliance site can add an iframe to your site to show a DKP list, here is an example:

Regular Page
Page inside iframe

Code

Add this code to a Free Form Text/HTML widget while in HTML mode on the same page as the widget you want to effect.
<script>
$(function(){
 var widgetToShow = "DKP"; // Only pick one widget

 // ****************************
 // Don't change anything below
 // ****************************

 if (top.location != self.location && /Guild.aspx/.test(top.location.pathname)) {
  var w = $('.ContentBoxTitle:contains(' + widgetToShow + ')').closest('.gpwidget');
  $('.gpWidget').not(w).hide();
  w.closest('.ContentZone').siblings().hide();
  $('.PageWrapper, .ContentWrapper').css('width', '100%');
  $('#bannerTable, .BannerArea, .WfTopMenu, .TabBar, .straightBarWrapper, .InnerTabTable').hide();
 }
});
</script>
Customizing
  • Change the "widgetToShow" variable to match a partial widget title (case sensitive).
  • Now on the other site, just add the following to a Free Form Text/HTML widget while the editor is in [ <> HTML ] mode
    <iframe src="URL TO PAGE" width="100%" height="800"></iframe>
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

Valdaglerion (Member) 6/23/2011 5:28 PM EST : RE: Widget in an iFrame
Valdaglerion
Posts: 2473

0
Like

0
Dislike

"Embedded page links pointing back to Guildportal are prohibited..."  
TopBottom

Mottie (SuperAdmin) 6/23/2011 8:20 PM EST : RE: Widget in an iFrame
ACK!
Mottie
Posts: 3883

0
Like

0
Dislike

DOH, well you can just make a Free Form Text/HTML widget and add this:
<iframe src="URL TO PAGE" width="100%" height="500"></iframe>
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

 
 
Key 
New posts No new posts
New posts ( popular ) No new posts ( popular )
New posts ( sticky ) No new posts ( sticky )
New posts ( locked ) No new posts ( locked )
 
 
Who's Online 
There are   members online.
 
 
So-and-so has logged on!
%title%
%message%