|
insertFrame
Insert a frame in a node
Installation
UseTo 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>]]]
Don't forget to set the input format the filter has been assigned to. Examples
[[[www.myurl.com/myapp.html]]] [[[www.myurl.com/myapp.html height=500px width=300px]]] [[[www.myurl.com/myapp.html id=myframe class=myCSSClass]]] FeaturesYou can add your own tags (tag=value). To custom code with this tags, you must create a theme function. To do this, add in your template.php a function called yourtheme_insertFrame_custom($onload, $iframe_params). The first param is the default code of onload event, the second, an array of all tags of the filter. You function may return any text that will be add as is in the IFRAME html tag. You can also theme the function insertFrame_init to add javascript for example. Exemple
// Add javascript
function mytheme_insertFrame_init() {
drupal_add_js(drupal_get_path('module', 'insertFrame') . '/myinsertFrame.js');
}
// Add resizing feature if resize=Y
function yourtheme_insertFrame_custom($onload, $iframe_params) {
if ($iframe_params["resize"] != "Y") {return $onload;}
return $onload . " onresize='resize(this)'";
}
Remarks
function yourtemplage_insertFrame_getURL($url) {
return token_replace($url);
}
|
Sign in to add a comment