Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable FluidTYPO3 page template and/or content elements

Tags:

typo3

fedext

I've a multi domain TYPO3 CMS installation where every of the X page trees has it's own page template and content elements build with FluidTYPO3.

At the moment the backend user sees all the templates and elements provided by the different provider extensions. The question is now: is it possible to disable page templates and content elements by some user defined conditions (fx if we are on a subpage of page Y only show page template A and content elements B,D and F?

Markus

like image 984
Markus Bischof Avatar asked Dec 10 '14 12:12

Markus Bischof


1 Answers

The solution is to have separate TS configurations for separate sets of templates.

See following example:

your_ext/Configuration/TypoScript/Set1/setup.txt:

plugin.tx_yourext.view {
    templateRootPath = EXT:your_ext/Resources/Private/Set1/Templates/
    partialRootPath = EXT:your_ext/Resources/Private/Set1/Partials/
    layoutRootPath = EXT:your_ext/Resources/Private/Set1/Layouts/
}

your_ext/Configuration/TypoScript/Set2/setup.txt:

plugin.tx_yourext.view {
    templateRootPath = EXT:your_ext/Resources/Private/Set2/Templates/
    partialRootPath = EXT:your_ext/Resources/Private/Set2/Partials/
    layoutRootPath = EXT:your_ext/Resources/Private/Set2/Layouts/
}

your_ext/ext_tables.php

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript/Set1', 'Templates Set1');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript/Set2', 'Templates Set2');

So, then you can include desired set at specified TS template in a tree. E.g. your structure is:

root
 |
 |- Home1 (TS Template)
 |   |
 |   |- Page 1
 |   |- Page 2
 |- Home2 (TS Template)
     |
     |- Page 1
     |- Page 2

Then you can include "Templates Set1" at your "Home1" TS template, but "Templates Set2" at your "Home2" TS template.

The only drawback: you can't use two sets at same time on same page.

More info at offcial manual.

Update 05.03.2015: A ticket was created to track issue with no possibility to unset custom CEs, and now this issue is finally solved. So, taking an example from commit message above, one could do this:

# disable the "Alert" element:
plugin.tx_fluidbootstraptheme.forms.alert.enabled = 0
like image 88
Viktor Livakivskyi Avatar answered Nov 10 '22 09:11

Viktor Livakivskyi