[TYPO3-english] Embedding Remote Content into Typo3 CMS Page
Markus Kobligk
markus at kobligk.de
Tue Jun 28 01:07:20 CEST 2011
Hi Adam,
Am 28.06.2011 00:29, schrieb Adam Retter:
> I am very new to Typo3, but not to web development or CMSs in general.
Welcome to the club :)
> Within Typo3, when a specific page is loaded from the CMS -
> I need to be able to make a Request to a remote URL, receive a HTML
> document, extract parts of that document and embed them into the
> returned page. I will also need to be able to insert parts of the
> extracted document into the<head> of the returned page. As Typo3 uses
> a templating approach, it is not clear to me how to achieve this.
Well, sounds like a pure javascript/ajax approach with manipulation the
DOM with the received data afterwards. You could do this without
configuring/extending TYPO3 at all. Just include a javascript file on
the pages where you need it or extend an existing one.
There are other approaches, but if you are new to TYPO3 this seems to be
the easiest one I think. The <head> data is normally defined within the
Typoscript setup. You can insert specific non-standard code there with a
userFunc. That userFunc calls a PHP class which generates the code you
want to insert into the <head>. Google for "TYPO3 headerData userFunc"
and you will get plenty of examples :)
The HTML content from the remote site that you want to insert into the
<body> of your page could be done with a userFunc as well or with an
TYPO3 extension that is inserted on the specific page as a plugin or
included via Typoscript. This extension would load the remote site (curl
or javasript) and insert the needed code into the DOM, so both require
the remote page to be loaded first, which leeds again to the above
approach with pure javascript I think.
There are often different ways to reach your goal in TYPO3 as you may
have noticed, I don't thinnk there is a "best way" for your problem.
I'd try the pure javascript approach since it may be the easiest for you.
> Also, it appears that TypoScript does not seem to be a full-fledged
> Server side programming language, or am I missing something? If not,
> is there something else as well like server side JavaScript in Typo3?
Typoscript ain't a "programming language" at all :)
See: http://tinyurl.com/6gtegxg (What is Typoscript)
BTW: What do you mean with "server side javascript"?
Javascript is always client side, as far as I know ;)
greets,
Markus
More information about the TYPO3-english
mailing list