Jump to content

Troy

Trumba Community Member
  • Posts

    46
  • Joined

  • Last visited

Posts posted by Troy

  1. Yes, of course it's chopped, very typical of IFRAME height. You can paste the following code into your events.htm file to get it to auto-size to the calendar.

     

    <script type="text\javascript">
    function resizeIFrame() {
    var name = window.name;
    var iframe = window.parent.getElementById(name);
    
    if (iframe == null)
     iframe = window.parent.frames[name];
    
    if (iframe != null) {
     // adjust the iframe's height based on its contents
     if (iframe.contentDocument && iframe.contentDocument.body.offsetHeight)
      iframe.height = Math.min(iframe.contentDocument.body.offsetHeight, 10000);  // netscape/firefox
     else if (iframe.Document && iframe.Document.body.scrollHeight)
      iframe.height = Math.min(iframe.Document.body.scrollHeight, 10000) + 2;   // internet explorer
    }
    }
    
    window.onload = resizeIFrame;
    window.onresize = resizeIFrame;
    </script>
    Mind you I wrote this really fast and wasn't able to test the code. I'll try it out in the morning but you can go ahead and try it right now if you want. The idea is that whenever your iframe loads or resizes you redo the document height. This is a known and tricky issue with IFRAMEs. It's based on code inside our Spuds that does essentially the same thing. There could be an issue if the Spud grows too much but we'll deal with that when we get there.
  2. All Trumba spud (widget) code is JavaScript, so unfortunately there is no way to embed Trumba spuds without using JavaScript. However you could fake the embed by instead embedding the Trumba Hosted version of any published calendar. For example, you could embed this using an IFRAME or a FRAMESET. Here's an IFRAME that does just that:

    <html>
    <body>
    <iframe src="[url="https://www.trumba.com/calendars/webname"]https://www.trumba.com/calendars/webname" frameborder="0" width="100%" height="100%"></iframe>
    </body>
    </html>
    
     

    When using the Trumba Hosted view, you are limited by the layout, the limited spuds and Trumba branding. To get a lesser set of Spuds you'd have to use JavaScript. We also offer CSV, ICS, XML, RSS and JSON feeds for every published calendar that you can pull and possibly parse to embed and render a calendar on your site.

    CUSTOMIZE CALENDAR FEEDS: https://www.trumba.com/help/api/customfeeds.aspx

  3. Kevin,

     

    This is a very interesting situation that I haven't encountered yet. Thanks for bringing it to my attention. What's happening here is that you've nested a Spud inside an IFRAME that you are re-using for navigation. I'm talking about MainiFrame. Normally this Spud would have not interfered with the operation of your IFRAME and your site would work as you would expect. However you added an Upcoming Spud to your home page which is causing the main calendar Spud inside events.html to take over your MainiFrame. This is actually intentional and is used to support our older but now deprecated method of putting Spuds in IFRAMEs. Here's how you can fix it.

     

    First you need to create a new file called eventsiframe.htm and place it in the same directory as events.htm. Here's the source for eventsiframe.htm:

     

    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    </head>
    <body>
    <script type="text/javascript" src="http://www.trumba.com/k.aspx?calendar=saaac_calendar"></script>
    </body>
    </html>
     

     

    Now you need to edit your original events.htm and replace the <script>...</script> tag that points to trumba with a new <iframe></iframe> tag that points to the eventsiframe.htm file that you just created. Here's the what the source of events.htm looks like now:

     

    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Events</title>
    </head>
    
    <body>
    
    <b><font face="Arial">Events (2006-2007 School Year)</font></b>
    <br>
    <hr>
    
    <table border="0" width="100%" id="table2" cellspacing="0" cellpadding="0">
    <tr>
     <td> <iframe id="TrumbaIFrame" src="eventsiframe.html" frameborder="no" width="100%" scrolling="no" marginheight="0" marginwidth="0" allowtransparency="true"></iframe></td>
    </tr>
    </table>
    
    </html>
     

     

    What I'm doing with this fix is that I'm creating the Spud inside it's own IFRAME which in turn lives inside your MainiFrame. This avoids the conflict between the Upcoming and Calendar Spuds and gets your site working again.

  4. You need to wrap the Trumba spud javascript code  in a DIV or TABLE to enforce size. Here is an HTML page outlining both of these methods. The first is a fixed sized DIV of 600px wide and 400px tall. It smashes the calendar into a very small space. The second is a variable sized table whose width is 80% of the page. It flows very nicely.

    <html><body>
    
    <p>Calendar Spud inside a fixed width DIV.</p>
    <div style="width:600px;overflow:auto;height:400px;">
    <script type="text/javascript" src="//www.trumba.com/k.aspx?calendar=trumba-u&template=month"></script>
    </div>
    
    <p>Calendar Spud inside a variable width TABLE.</p>
    <table style="width:80%;"> 
    <tr><td>
    <script type="text/javascript" src="//www.trumba.com/k.aspx?calendar=trumba-u&template=month"></script>
    </td></tr>
    </table>
    
    </body></html>
     
  5. The Trumba RSS link for any calendar will always direct you to and return the XML that constitutes the RSS feed of a calendar.

    The XML is meant to be consumed by an RSS reader(aka Blog Reader), but some older browsers will display it raw if they don't know what to do with it. Many modern web browsers today will, instead of showing you just the raw XML, show you the data in a blog style format. FireFox and Mozilla will show you raw XML if click the RSS link. However, if you click the RSS icon in the lower right corner of the browser and select "Subscribe to 'X' Events Calendar'", it will create a bookmark that subscribes you to the blog. Safari will always show you a blog format if you click the RSS link, which is very nice. Typically you need to either need to drag and drop the RSS icon into an RSS reader or copy the RSS address and paste it into the reader. The reader will then handle subscribing.

×
×
  • Create New...