[Typo3-dev] Calling a plugin from within another plugin

Boris Nicolai bnscs at gmx.de
Tue Jan 13 13:46:31 CET 2004


Hi,
I made it the following way:

in the file, where's the class of your plugin include the other plugin:

require_once (t3lib_extMgm::extPath
("sourceopt")."pi1/class.tx_sourceopt_pi1.php");

replace sourceopt by your extension-key.

and then the following call:
$tx_sourceopt_pi1 =& new tx_sourceopt_pi1 ();
$tx_sourceopt_pi1->main (&$this->content, &configuration_stuff);


hope this helps


> -----Original Message-----
> From: typo3-dev-bounces at lists.netfielders.de
> [mailto:typo3-dev-bounces at lists.netfielders.de]On Behalf Of S. Teuber
> Sent: 13 January 2004 13:41
> To: typo3-dev at lists.netfielders.de
> Subject: [Typo3-dev] Calling a plugin from within another plugin
>
>
> Hi everyone,
>
> is there any way to include content delivered by a plugin in another
> plugin?
>
> Scenario:
> I have a plugin that generates some output. I can call that plugin using
> TS as follows:
>
> temp.content1 < plugin.tx_firstplugin_pi1
>
> Works fine, the content that's coming from the plugin gets parsed (and
> displayed by setting marks.BLA < temp.content1).
>
>
> Now, I have a second plugin that works the very same way, like this:
>
> temp.content2 < plugin.tx_secondplugin_pi1
>
> No problem whatsoever. BUT, now there's the question: I need the second
> plugin to render one or more content-objects using the first plugin. I
> already tried using cObjGetSingle() in the 2nd plugin the following way:
>
> $content = $this->cObj->cObjGetSingle(
>              '< plugin.tx_firstplugin_pi1',
>              array(),
>              'content1'
>          );
>
> Since this didn't work, I tried something more "basic":
>
> $content = $this->cObj->cObjGetSingle(
>              '< styles.content.get',
>              array(),
>              ''
>          );
>
> To no avail. Apparently I didn't quite really understand how
> cObjGetSingle() works, although I peeked into the sourcecode of
> class.tslib_content.php. :-(
>
> Maybe someone can help? I'd really appreciate it.
>
> Thanx in advance,
>
> Sven
> _______________________________________________
> Typo3-dev mailing list
> Typo3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
>
>






More information about the TYPO3-dev mailing list