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

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]

Related

typo3 add content element to all pages that are direct child of a certain page using typoscript

I have defined a menu content element using typoscript:
lib.share = COA
lib.share {
wrap = <div class="shareLinkBlock">|</div>
1 = TEXT
1.data = page : title
...
I would like to add this menu to colPos 2 of every page, that is direct child of a certain page.
Is there any way to achieve that?
Thanks a lot!
A solution depends on the current realization of the page.
If you use only typoscript you can replace the colPos2 rendering with a COA where your typoscript is part one and the old rendering is a second part.
Using conditions can restrict the appearance to selected page trees.
In similar ways you can realize it with FLUID.
You can insert a fluid variable, filled with your typoscript in every page.
The restriction to special page trees can be realized with conditions in typoscript or in FLUID. Also you can use different page-layouts for pages with and without this menu.
another solution would be an additional backend column which gets inherited and where you fill in your menu for those pages where the menu starts being visible. (conditions like above)
EDIT:
if you want to enhance a given FLUID variable, defined in typoscript you can word with a COA:
:
10 = FLUIDTEMPLATE
10 {
:
variables {
enhancedColumn = COA
enhancedColumn {
10 = ..old definition ...
}
}
}
:
// make sure you use the correct conditions:
[PIDinRootline = 10]
...10.variables.20 < lib.footer
[global]

TYPO3: Site Configuration Data inside TSconfig Condition

The divider content element is disabled for all pages via TCEFORM.tt_content.CType.removeItems := addToList([…], div) in PageTSconfig. This works just fine.
Now I want that the divider is only available for a certain subset of pages.
I defined the uppermost page in my site configuration which leads to the following Typoscript:
[site("configuration")["settings"]["pages"]["simpleLanguage"] and site("configuration")["settings"]["pages"]["simpleLanguage"] in tree.rootLineIds]
TCEFORM.tt_content.CType.removeItems := removeFromList(div)
[END]
Now when I want to insert an divider on that given pages, I can choose it from the NewContentElement Wizard, but when the form of the content element gets rendered the divider is missing in the CType select.
Divider is shown in NewContentElement Wizard
But not in the content element form.
I found out that when setting the pageuid directly, the condition is evaluated fine.
So my conclusion ist that I cannot get site information inside TSconfig.
So how can I get the information from the site config inside TSconfig?
Conditions in PageTS have been fixed for TYPO3 v10 with https://forge.typo3.org/issues/89718.
The patch has not been backported to v9 due to its complexity.
The new content element wizard uses another configuration:
https://docs.typo3.org/m/typo3/reference-tsconfig/master/en-us/PageTsconfig/Mod.html#newcontentelement-wizarditems
# PageTS
# CType "div" is in group "special"
mod.wizards.newContentElement.wizardItems.special.show := removeFromList(div)

TYPO3 hide content element options in wizard

I want to show only the column options from the grid elements tab to the editors group when they create a new content element. So I tried to edit the groups TSconfig.
tx_gridelements.setup.tabs4 >
tx_gridelements.setup.tabs6 >
This has no effect. How do I remove all but the column options?
Update: With your help I figured out that my problem is not about the text in the TSconfig but that it is not loaded from the backend user group nor the beuser.
The elements you want to disable are located in Page TSconfig under mod.wizards.newContentElement.wizardItems. You can see them in the "Info" module under "Page TSconfig" :
You can simply disable them by adding
# example for the given screenshot
mod.wizards.newContentElement.wizardItems.common.elements.header >
I don't think that the answer from #statix will work with grid elements.
But in the settings of your backend layout, you can define what type of content elements are allowed within a specific content area:
And within the settings of each grid element you can define again, which content elements are available, e.g. to prevent nesting of grid elements.
Put this code in root page tscPage TSConfig
tx_gridelements.excludeLayoutIds=your grid id
May It helps you!!

Hide specific elements on page (Typoscript)

Is there some way how to hide specific elements on specific page using Typoscript in TYPO3?
The URL is for example: www.mywebsite.com/subpage1
I want to hide menu and footer part only on this subpage1.
Thank you
If the menu and footer are created through TypoScript you can use conditions in TypoScript to overwrite them. For example:
lib.footer = TEXT
lib.footer.value = This is my footer
[globalVar = TSFE:id = 4]
lib.footer >
[global]
In this example the uid of the page where I want to not show the footer is 4.
More on conditions in TypoScript can be found here: https://docs.typo3.org/typo3cms/TyposcriptReference/Conditions/Reference.html
A clean way would be to define different page-layouts and assign them to the pages where these elements are not desired. With fluid partials you could recycle most parts of the page and depending on the layout render footer and menu.
As you get a nice inheritance mostly the fields backend_layout and backend_layout_next_level are used. You will find a lot of examples.
fluid handling could be found in typoscript backend_layout_next_level not working.
For templa voila (=TV) you can use a similar attempt: select different TV-templates depending on these fields.
Duplicate the given template, remove footer and menu and insert the new template to the set of given templates.

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
}