[TYPO3-v4] Condition for loaded extensions?

Ernesto Baschny [cron IT] ernst at cron-it.de
Thu Feb 24 08:32:12 CET 2011


Philipp Gampe schrieb am 24.02.2011 01:21:
> Hi Thomas,
> 
> Thomas Allmer wrote:
>> I guess it would be cool if there would be a condition just for records.
>> If explicitly defined that way I think it would be ok and quite helpful.
>>
>> Let's see the following usecase:
>> Gallery plugin which just reads a directory and displays it pictures as
>> thumbnails in a given size with a link to a bigger version. This plugin
>> get's inserted by the editors them self as they see fit.
>> Now I wish to use a javascript lightbox. So I have 2 solutions
>> 1) load the js stuff globally and us js to see if it should do something
>> or not [probably unnecessary js code on a lot of pages]
>> 2) modify/extend the plugin [no updates, probably quite complex, changes
>> of the js options not easily possible (extra TCA)...]
> 
> You could do this with normal TS if you make a condition if the field 
> list_type of any content on current page element contains the name of your 
> plugin.
> 
> But if course a conditionen like 
> [pluginLoaded = indexed_search]
> page.includeJS.lightbox = fileadmin/res/lightbox.js
> [global]
> would be much more readable

Would be, but also misleading. As I mentioned before, its not possible
to know which plugin is loaded. So to be more precise, the condition
would have to be something like:

[hasRecordOnPage = tt_content : list_type='indexed_search']
page.includeJS.lightbox = fileadmin/res/lightbox.js
[global]

So specifically doing some kind of "query" for certain records on the
current page (in this case a "tt_content" matching
list_type='indexed_search').

Cheers,
Ernesto


More information about the TYPO3-project-v4 mailing list