Disable FluidTYPO3 page template and/or content elements - typo3

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

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

What I have done for a project is to generate a directory tree based on the site name:
site1
templates
layouts
Partials
site2
templates
layouts
Partials
I than created:
plugin.tx_yourprovidername.settings.sitename = site1
I could then use this in my template :
<f:layout name="{settings.sitename}/nameoflayout"/>

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 ...

Related

Typo3 News Extension: "TypoScript object path "lib.tx_news.contentElementRendering" does not exist"

Without knowingly having changed something in the configuration or templates, I can't output content elements in the detail view of news-articles.
1/1) #1253191023 TYPO3Fluid\Fluid\Core\ViewHelper\Exception
TypoScript object path "lib.tx_news.contentElementRendering" does not exist
I have this configuration:
typo3conf/ext/news/Configuration/TypoScript/setup.txt
# Rendering of content elements in detail view
lib.tx_news.contentElementRendering = RECORDS
lib.tx_news.contentElementRendering {
tables = tt_content
source.current = 1
dontCheckPid = 1
}
typo3conf/ext/site_package/Resources/Plugin/News/Templates/News/Detail.html
<f:if condition="{newsItem.contentElements}">
<!-- content elements -->
<f:cObject typoscriptObjectPath="lib.tx_news.contentElementRendering">
{newsItem.contentElementIdList}
</f:cObject>
</f:if>
So it looks to me as it is what is recommended in the docs: https://docs.typo3.org/p/georgringer/news/master/en-us/Tutorials/Templates/RenderContentElements/Index.html
Typo3 version: 10.4.12
News version: 8.5.2
I can't figure out why I can't output content-elements in news-articles all of the sudden.
Can anyone help?
If lib.tx_news.contentElementRenderingis not defined, most likely you've forgotten to include the static TypoScript Template of EXT:news.
News system - Installation:
Preparation: Include static TypoScript
The extension ships some TypoScript code which needs to be included.
Switch to the root page of your site.
Switch to the Template module and select Info/Modify.
Press the link Edit the whole template record and switch to the tab Includes.
Select News (news) at the field Include static (from extensions):

How to get the Log In Form on every page? (for example in footer) Typo3

Is there a way to get the Log In Form for Frontend User on every page? I would prefer the footer.
And if someone is logged in you can see the Log Out Button.
Is this possible without an extension?
You can copy the default felogin output to wherever you want on your template. For example use lib.login, copy the plugin.tx_felogin_pi1 into it, change the template and you're fine.
lib.login < plugin.tx_felogin_pi1
lib.login.templateFile = path/to/your/template/file
More you can see in the official documentation: https://docs.typo3.org/typo3cms/extensions/felogin/8.7/Configuration/Index.html
In general there are three options to include a CE (e.g. the Login-form) on all pages:
use typoscript to generate the CE. Normally the CEs are defined in tt_content, from where you could copy the base configuration and adapt it. For some plugins you also find a complete configuration beyond lib (for newer extensions there you only find the settings). All the configuration must be done in typoscript.
use typoscript to render the content of a special page/ column. In this variant you have a special page only for content referenced somewhere else. Advantage: you could configure the CE in the usual way. Try to avoid referencing CEs by uid as an editor might disable or delete the current element(s) and insert a new one which would not be rendered.
use a special column in your root page and inherit the content to all subpages. Advantage: you could change the inherited content easily on each page (if this column is available in the current backend layout).
example for 3:
variables {
footer_content < styles.content.get
footer_content.select.where = colPos = 15
footer_content.slide = -1
}

How to hide the output comming from an inherited content element?

On a sub page I am inheriting multiple content elements from a parent page. Now I need to hide one of them, while keeping the rest untouched.
Any ideas?
One idea would be to use TypoScript to hide the output from the respective content element or plugin.
Identify the responsible element for the output using TYPO3 ADMIN PANEL.
Create a new template for the page (List view) and add the necessary configuration in the Setup field.
Below is an example:
[globalVar = TSFE:id = YOURPAGEID]
plugin.tx_exampleplugin >
[global]

ExtBase Detail View in Lightbox

I made an Extension with Extbase and iwant the detail view to be shown in a lightbox and it does. The Problem is: I dont want the main template (of the main page with navigation etc.) to be seen, but just the detailed view. What do I have to change, to exclude the Main Template?
Use dedicated typeNum for this content and in its TS configuration set: disableAllHeaderCode = 1, it can be compared to the common way of rendering pure AJAX types like showed in the other sample.
For an example put this into your TypoScript template
myPurePage = PAGE
myPurePage {
typeNum = 1234
10 < styles.content.get
config {
disableAllHeaderCode = 1
}
}
So if you'll call it by http://yourdomain.tld/?id=123&type=1234 it will show only content of the main column from page with UID 123 (without html, body sections, any navigations from default template, etc, etc)
An alternative to the solution #biesior provided: Use the extension typoscript_rendering. It provides a ViewHelper to generate a link that renders only the view for an extbase action, without the layout.

Nothing appears in Typo3 with powermail (Frontend)

I need help with powermail.
I'm using Typo3 6.2.4 and powermail 2.0.16.
Something is wrong cause nothing appear in the frontend, but I don't what and I need some helps.
I created a new root page with the basic template "HELLO WORLD!" (ID = 15).
# Default PAGE object:
page = PAGE
page.10 = TEXT
page.10.value = HELLO WORLD!
In this template, I included two statics templates : "Main Template (powermail)" and "Add basic CSS (powermail)"
After that, in the root page, I created the folder "Powermail" to stock the data. (ID = 241)
And I created a second folder ("Form"; ID = 242).
In the folder "Form", I created a new Form ("registration") with the setting : Layout=Layout1; Language=Default; And the checkbox "Hide" is not checked
In this one, one Pages ("registration data") with the setting : Layout=Layout2; Language=Default; And the checkbox "Hide" is not checked
In "registration data", two fields, one for the name (Name of the sender) and one for the mail (Email of the sender) with setting : Mandatory Field=Checked; Layout=Layout3; Language=Default; And the checkbox "Hide" is not checked
And after that, in the root page, I created a new content element "powermail".
In the tab General, I set the header = Registration
In the tab Plugin, I selected Powermail. After, this is the setting : Selected Items=registration; Confirm page=checked;
Receivers Name=My Name; Receivers Email=MyName#gmail.com; Subject=My test;
Sender Name=A Name; Sender Email=AName#gmail.com; Subject=test;
In the tab Behaviour, Recursive=0 levels;
It seems that you are missing the proper typoscript to actually show the form on the page.
The specified typoscript snippet is not enough to show the content elements on the page.
Inside your typoscript template include the css_styled_content static template and change the snippet to this:
# Default PAGE object:
page = PAGE
page.10 < styles.content.get
That should ensure proper showing on the frontend. This is basic as it is, if you want it to be better looking, or different templating you should take a look at templating with TYPO3 first.