How to import an external page into content div

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
tvdk
Forum Members
Forum Members
Posts: 41
Joined: Tue Jul 01, 2008 9:39 pm

How to import an external page into content div

Post 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
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: How to import an external page into content div

Post 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...
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “Modules/Add-Ons”