Is there a way to show IFrame Channel content without scrollbars?
In many cases it would be ideal, if the iframe used to display other web content would automatically adjust to the content height. By default, (X)HTML allows the iframe element to provide a height and width attribute in pixels or percentage. However, the percentage is a percentage of the page (or parent container) holding the iframe, not the iframe content itself.
The Inline Frame Channel in uPortal (and Academus) does not provide support for this type of behavior. Through the Channel Manager the IFrame's height value can be set as allowed in HTML, as either a pixel or percentage.
It is possible to add this sort of behavior for content included through IFrames that are hosted within the same domain. This is a limitation because of the cross-domain security measures built into browsers.
The solution requires the addition of JavaScript to the page that will read the content height, and set the iframe size accordingly. Here is a article discussing one such JavaScript solution for web pages in general.
This solution could be applied to uPortal (and Academus) by adding JavaScript to the portal theme that would scan the page for IFrames that meet a certain criteria (one specific channel, all IFrames within the current domain, or whatever), and apply the resizing to each. This script would be need to be run at least once per page load. If the user is likely to navigate within the content, then logic would need to be added to identify that and resize accordingly.
Another alternative would be to add the JavaScript for the resizing to the content itself. That script on load would automatically go the parent frame/window (in this case the portal) and set the iframe size. It would need to know which iframe to adjust, but this approach would support the case where the user navigates within the iframe content. This approach is used by Sakai for its tools.
Please keep in mind that changes to the Academus theme may make it more difficult to support or maintain. Patches and upgrades may affect the theme file such that custom changes would need to be reapplied.
If you are interested in this sort of custom work, and do not have the resources to accomplish it, you may want to consider contacting Unicon Professional Services for assistance.
