Version 2.4 beta 1 (27th April 2009)
A wrapper is just an iframe. This wrapper plugin enables you to embed external and internal web sites like a forum, galleries etc. into a CMSimple web page. Using the wrapper will not change menu handling and the structure of a CMSimple page.
This wrapper comes with three functions, the normal wrapping and two auto-wrapping functions.
(a) The normal wrapping function is thought to embed websites hosted under external domains.
(b)+( c) The auto-wrapping functions allow a flexible height of an iframe. No vertical scrollbar will enoy you. However, these functions are able to embed only such websites which are hosted under your own domain. Websites of external domains cannot be embedded by these functions!!!
The auto-wrapping functions were realized by (b) using the IFrame SSI script II of Dynamic Drive and as altenative ( c) the more recent script written by John Davenport Scheuer and publlished in the forum of Dynamic Drive (Sorry, the original code of this iframe version has been removed by Dynamic Drive. The reason is not clear to me, since the code works well in my hands and seems to have some advantages over the older one. Till). Which one of the two works better under certain conditions has to be tested.
What does autowrapper do?
This script adjusts the iFrame while the user interacts with the page inside of the iFrame. For example: If a user clicks through a shop located inside autowrapper's iFrame, usually the page of the shop shrinks or expands according to the amount of products listed. Autowrapper has the ability to adjust the iFrame's height while the user is interacting with the shop.
After unzipping the compressed plugin file you copy it into the “plugins” subfolder as any other plugin as well. While in administration only two buttons will appear: “plugin-stylesheet” and “plugin-help”. In “plugin-stylesheet” you can change appearence and dimensions of the wrapper by using standard CSS. The button “plugin-help” will just call-up this help page.
In order to embed an external page you use a CMSimple script in the following format:
(a) In case of websites hosted under external or own domains:
#CMSimple $output. = wrap($Url, $width, $height, $scrolling, $allowtransparency, $gettxt, $errtxt);#
(b) In case of websites hosted only under an own domain:
#CMSimple $output. = autowrap($Url, $width, $height, $scrolling, $allowtransparency, $gettxt, $errtxt);#
( c) New: As alternative for websites hosted only under an own domain:
#CMSimple $output. = autowrap2($Url, $width, $height, $scrolling, $allowtransparency, $gettxt, $errtxt);#
$Url - you use an internet address.
$width - you add the width of the iframe (in px or %).
$height - you add the height of the iframe (in px).
$scrolling - you define scrollbars or exclude them (yes|no|auto).
$allowtransparency - you determine the Microsoft proprietary feature attribute of transparency (true|false), which is only important for IE6. All other browsers show background transparency by default.
$gettxt - you add the text which should be shown while the external page is loading. Instead of text also images can be called up by adding their html address.
$errtxt - you add the text which should be shown, if the page cannot be found.
To embed this wiki, for example, use the following code:
#CMSimple $output.= wrap("http://cmsimplewiki.com/", "100%", "500", "auto", "true","Site is loading", "Page cannot be found.");#
To embed the Quick.Cart shop, for example, use the following code:
#CMSimple $output.= autowrap("./shop/index.php", "100%", "500", "auto", "true", "Site is loading", "Page cannot be found.");#
You must not omit any of the attributes in the function. If you do so, the script may not run properly! If you don't need one of the attributes, just use empty quotations marks - ie: #CMSimple $output.=wrap(“http://cmsimplewiki.com/”, “100%”, “500”, “auto”, ””, “Site is loading”, “Page cannot be found.”);#
Of course, you can run wrapper and/or autowrapper on more than just one CMSimple page - but only one wrapper per page.
a. Image instead of Text
If you want to show an image instead of text during loading time, you may say:
#CMSimple $output.= wrap("http://cmsimplewiki.com/", "100%", "500", "auto","true", "<img src='plugins/wrapper/images/loading.gif'> ", "Page cannot be found");#
An image file called “loading.gif” can be found in wrapper's subdirectory ”/images”.
b. Vertical Scrollbar in Autowrapper
Sometimes autoWrapper seems to receive wrong values of the Firefox iFrame window. In that case a scrollbar will be shown, even though autoWrapper is in use. We can get rid of this scrollbar by finetuning. In line 71 of the index.php file of the wrapper plugin it says:
$hjs.= "var FFextraHeight=getFFVersion>=0.1? 16 : 0 \n";
If the “0” is exchanged by a higher value, the height of the iFrame window in Firefox is increased of about the same value of pixels.
$hjs.= "var FFextraHeight=getFFVersion>=0.1? 16 : 50 \n";
would increase the FF iFrame window's height of 50 pixels. The scrollbar will disappear. These 50 pixels will be used in additional calculations of iframe heights, which would follow the initial page.
c. Horizontal Scrollbar in Autowrapper
autoWrapper's default setting is scrolling=“no”. However, it is possible that ifame page switching results not only in different height of the iframe. Also the width may be affected. While the height is automatically adjusted, the width is not. The width fills always up to 100% of the room the template offers. If the width exeeds the template's room, we need a horizontal scrollbar. In that case we change in line 131 of wrapper's index.php file scrolling to: scrolling=\”auto\”.
For more detailed explanations see the wrapper help files.
There is no warrenty using this plugin. It will be used on everybody's own risk. We will not assume any liability in case of data losses caused by Wrapper usage.