Wrapper

Version 2.2 (1st March, 2008)

A wrapper is just an iframe. This wrapper plugin enables you to embed external and internal web sites like a forum, a shop, or a gallery 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 two functions, the normal wrapping and the auto-wrapping function. (a) The normal wrapping function is thought to embed websites hosted under external domains. (b) The auto-wrapping function allows a flexible height of an iframe. No vertical scrollbar will enoy you. However, this function is able to embed only such websites which are hosted under your own domain. Websites of external domains cannot be embedded by this function!!! The auto-wrapping function was realized by using the IFrame SSI script II of Dynamic Drive.

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.

Download page
Direct Download

1. Installation

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);#

or

(b) In case of websites hosted only under an own domain:

#CMSimple $output. = autowrap($Url, $width, $height, $scrolling, $allowtransparency, $gettxt, $errtxt);#

Instead of:
$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 “Google”, for example, use the following code:

#CMSimple $output.= wrap("http://www.google.de", "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.");#

In case of autoWrapper you have to define height and scrolling as well, since autoWrapper - which is a javascript - is able to also run in a non-script area. So, you should test, how the autowrapper works, if javascript has been inactivated.

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://www.google.de“, “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.

Suggestions

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://www.google.de", "100%", "500", "auto","true", "<img src='/dokuphp/plugins/wrapper/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, the autowrapper still has to perform.

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.

2. Disclaimer

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.

3. Acknowledgement

The code of the wrapper had originally been developed by Rolf Amfelt (alf149) as addon (see: CMSimple Forum).

Wrapper
(click image to enlarge)

back to plugins
Check also GXgeturl for comparison

plugins/wrapper.txt · Last modified: 2008/06/04 09:19 by till