insertFrame
Description
This filter allows to insert a frame (or iframe) in a node.
The height can be calculated to show entire page. Navigation in frame resize the iframe object.
Installation
- Extract zip file in the modules directory (See download page)
- Enable the module in the admin settings
- Add the filter to an input format.
Use
To insert a frame in a node in drupal, add the following :
[[[<url> width=<w> height=<h> scrolling=<yes|no|auto> className=<class> ID=<id> offset=<offset>]]]
where :
- url is the url of the included page (required)
- w is then width as css declaration (%,px,em). Default : 100%
- h is the height as css declaration (%,px,em). If height=100% and url is in the same domain as web site, the height will be ajusted to the real height of the source. Default : 100%
- scrolling is scrollbar settings. Values from IFRAME tag. Default : no
- class is the name of a css class
- Id is the id and name of the frame. Default : iframe + no of the iframe in page
- offset is a number to add to adjust (if needed) auto calculated height
Don't forget to set the input format the filter has been assigned to.
Adding own tags
Since 1.8, you can add your own tags and behaviour. To do this, you must use the theme function insertFrame_custom to add specific behaviour. This function takes in arguments a string containing onload event code and an array of all tags. It must returns a string to be added as is into iframe tag.
To add specific javascript, you can use the theme function insertFrame_init.
Examples
- To include the page www.myurl.com/myapp.html with auto-height with a width of 100%
[[[www.myurl.com/myapp.html]]] - To include the page www.myurl.com/myapp.html with height of 500px and width of 300px
[[[www.myurl.com/myapp.html height=500px width=300px]]] - To include a frame of id myframe with the myCSSClass css class
[[[www.myurl.com/myapp.html id=myframe class=myCSSClass]]]
Remarks
- You can use the filter with wiki modules but you must enclose the lines with <nowiki> tag.
- if HTML filter is active, add <iframe> in the "Allowed HTML tags" input box in the configure tab of your input format
- You can manipulate then url (with token module for example) by theming the function insertFrame_getURL($url).
<?php
function yourtemplage_insertFrame_getURL($url) {
return token_replace($url);
}
?>
IMPORTANT
Cause firewall restriction, i can't manage easily releases.
Please check http://code.google.com/p/mmr-drupal-modules/wiki/insertFrame for new releases or updates.
Releases
| Official releases | Date | Size | Links | Status | |
|---|---|---|---|---|---|
| 6.x-1.8 | 2009-May-16 | 7.83 KB | Download · Release notes | Recommended for 6.x | |
| 5.x-1.8 | 2009-May-16 | 7.78 KB | Download · Release notes | Recommended for 5.x | |
