Reputation: 189
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
Upvotes: 6
Views: 2025
Reputation: 1
there is at least a way to hide elements and tabs in the new content wizard. Add this to your page tsconfig and make sure you include it in your page tree (properties > resources > typoscript configuration):
mod.wizards.newContentElement.wizardItems.common.show =
This line will hide the "common" tab in the new content wizard. If you group your ce templates accordingly you can controll which elements are shown for a given page tree. You can also hide single elements using ":= removeFromList(yourElement1, ...)".
Keep in mind that this will only work for the new content wizard. When editing an element you can still select any ce from the "Fluid Content type" dropdown.
I'm still looking for ways to show and hide page templates and disable certain elements. I'll try to update this answer as soon as I find something :)
Cheers ...
Upvotes: 0
Reputation: 3228
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
Upvotes: 2
Reputation: 1264
What I have done for a project is to generate a directory tree based on the site name:
I than created:
plugin.tx_yourprovidername.settings.sitename = site1
I could then use this in my template :
<f:layout name="{settings.sitename}/nameoflayout"/>
Upvotes: 0