[TYPO3-v4] Condition for loaded extensions?

Thomas Allmer at at delusionworld.com
Thu Feb 24 10:34:02 CET 2011


On 24.02.2011 08:32, Ernesto Baschny [cron IT] wrote:
> 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').

looks pretty useful :)
but also quite complex?

could it defaults to tt_content and list_type?
so we have?
[hasRecordOnPage = 'indexed_search'] (with or without '')

as I guess this would be the default use case...?
-- 
+---------------------------------+-----------------------------------+
| Thomas Allmer                   |   http://www.delusionworld.com    |
| E-mail: at at delusionworld.com    |   phone: +43 699 16217064         |
+---------------------------------+-----------------------------------+


More information about the TYPO3-project-v4 mailing list