[TYPO3] Pass parameters to an extension

Rafael Álvarez romo at cartuja.csic.es
Wed Jun 18 01:10:51 CEST 2008


El 17/06/2008, a las 12:35, Peter Russ escribió:

> --- Original Nachricht ---
> Absender:   bernd wilke
> Datum:       17.06.2008 10:35:
>> on Tue, 17 Jun 2008 01:12:28 +0200, Rafael Álvarez wrote:
>>
>>> Hi guys,
>>>
>>> I have a particular problem but I think is a generic question. I  
>>> have a
>>> field in the fe_users table that contains a link to a pdf  
>>> document in
>>> the fileadmin tree. I want to create a link using feusersview to  
>>> another
>>> page to see the document with sk_pdfviewer. I don´t know how to  
>>> pass the
>>> page id and the document name to the sk_pdfviewer extension.In  
>>> general,
>>> how to pass parameters to an extension, is the information inside  
>>> the
>>> class.xxxx_pi.php file of the extension or I have to set a  
>>> variable and
>>> read it with typoscript for the target extension?. Maybe this is a
>>> simple question but I haven´t found the answer.
>>>
>> first: if you created your own field as file, your files will be  
>> copied
>> to the subdir of your extension beneath uploads and only the filename
>> (which might be modified!) is stored.

I upload files and the field will contain the filename and the path,  
actually contains a link to the file. I think this is correct, isn´t it?

>> you can pass paramters with typoscript:
>> plugin.tx_yourext_pi1.var1 = 123
>> can be read from your extensions as:
>> $conf['var1']
>> and keep in mind for subarrays:
>> plugin.tx_yourext_pi1.var2.subvar1 = 123
>> is         v--- watch this dot!
>> $conf['var2.']['subvar1']
>>
>> the other way would be a flexform which is more complex, but also  
>> more
>> flexible, as each usage of the plugin can get it's own parameters.
>>
>> in german:
>> http://www.pi-phi.de/t3v4/171.html
>>
>> bernd
>
> IMHO the easiest way would be to ask Steffen to support dynamic  
> passing
> of the pdf filename to the extension in piVars or rewrite the  
> extension
> to your needs as that are only a few lines of code.
>
> Peter.
>


Thanks Bernd and Peter. Finally, I have slightly modify sk_pdfviewer  
to get the pdf name, I have added another variable, abs_path, to know  
if the path to the file is relative to uploads/tx_skpdfviewer/ or is  
an absolute one. Maybe is a good idea to "officially" modify the  
extension.

Again, thanks a lot


More information about the TYPO3-english mailing list