Page 1 of 1

How to import an external page into content div

Posted: Mon Mar 12, 2012 11:24 am
by tvdk
Hi, i was wondering (can't find it obviously) whether it's possible to kind of 'import' an external website into my 'content' div ? Like you used to do with frames in the past.

Any help is appreciated.

Thanks
Ton

Re: How to import an external page into content div

Posted: Mon Mar 12, 2012 1:23 pm
by Rolf
Create UDT, named for example "read_webpage"

Code: Select all

$webpage = file_get_contents("http://www.cmsmadesimple.org/some-page");

$gCms = cmsms();
$smarty = &$gCms->GetSmarty();
$smarty->assign('webpage', $webpage);
In your template you call this UDT like:

Code: Select all

{read_webpage}
<div id="blah">{$webpage}</div>
Hope this helps,

Rolf


ps. you can import the pagesource with this. not the whole page layout...