Feb 10
An enzyme for transcluding a web page
Enzymes can be complex PHP scripts, but basic enzymes are also very useful. This one is a oneliner, and it allows to transclude a web page inside a post. Really all the magic is played by an IFRAME element, but Enzymes makes it easy to use the method over and over, without any need to remember: “how did I do it?”
this is got by the statement {[.page(.google)]}
this is got by the statement {[.page(.yahoo)]}
Here is the code for the page field:
echo "<iframe width='450' height='200' src='" . $this->substrate . "'></iframe>";
Here is the code for the google and yahoo fields respectively:
http://www.google.com/
http://www.yahoo.com/
Easy, isn’t it?
