I need to display a breadcrumb menu where the first two levels are skipped.
Menus of type Menu have a property entryLevel to control where the menu starts, but it seems that is not the case for Breadcrumb. (At least it has no effect.)
Is there a way to accomplish this in Neos?
Breadcrumb is defined in TYPO3.Neos/Resources/Private/TypoScript/Prototypes/Breadcrumb.ts2 and you can overwrite values from there in Root.ts2 in your site package. So you can change templatePath and handle it using iterator in f:for or even better just limit (slice) items you pass to template on TS2 level. Translating it to code, you have Your.Site.Package/Resources/Private/TypoScript/Root.ts2 and there your page definition, just change Breadcrumb part:
page = Page {
...
body {
templatePath = 'resource://Your.Site.Package/Private/Templates/Page/Default.html'
sectionName = 'body'
parts {
menu = Menu
breadcrumb = Breadcrumb {
# replace items with itemCollection if you're using BreadcrumbMenu (Neos 2+)
items = ${q(node).add(q(node).parents('[instanceof TYPO3.Neos:Document]')).slice(0, -2).get()}
}
}
...
Related
I have some content elements in a site package which I want to show up in the content element wizard as explained here:
https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/ContentElements/ContentElementsWizard.html
Basically I have done the same as shown in the section "Create a new tab"
Configuration\TsConfig\Page\ContentElement\All.tsconfig is looking like this:
mod.wizards.newContentElement.wizardItems.mci.header = MCI
mod.wizards.newContentElement.wizardItems.mci {
elements {
mci_home_banner {
iconIdentifier = home-banner
title = Home-Banner
description = Banner der Startseite
tt_content_defValues.CType = mci_home_banner
}
mci_home_banner_element {
iconIdentifier = home-banner-element
title = Home Banner Element
description = Element im Starseitenbanner
tt_content_defValues.CType = mci_home_banner_element
}
}
show := addToList(mci_home_banner, mci_home_banner_element)
}
I reduced the code to just 2 elements. They are not shown at all, but are available over the dropdown, so I can switch to one of them after choosing another element.
This didn't work when created in 9.5 and still does not work after switching to version 11.5.10
What am I missing?
#user414873 Did you try to add your custom elements to the "common" tab instead of your new one "mci"?
And did you try to use an existing icon identifier (e.g. "content-image" or an other one - see https://typo3.github.io/TYPO3.Icons/)? Just to make sure that there is no problem with your custom icons that prevents the elements from being displayed.
Does this minimal example work for you:
mod.wizards.newContentElement.wizardItems.common {
elements {
mci_home_banner {
iconIdentifier = content-image
title = Home-Banner
description = Banner der Startseite
tt_content_defValues.CType = mci_home_banner
}
}
show := addToList(mci_home_banner)
}
And I would doubt this:
I guess otherwise the content elements wouldn't be available at all.
I suggest you check it's correctly included by using the "Info" module in your TYPO3 main menu. Then select the page where the content element should be included and switch the dropdown on top of the content area to "View TSconfig fields content". Now you can search for "wizards" and check if your element is included.
Using PageTSConfig I want to add some template options to the tx_news plugin.
How do I make it so that List template options are only shown when list view is active, and the same for Detail template options?
I thought it would be something like this:
tx_news.templateLayouts {
types {
list {
1 = Alt List
}
detail {
2 = Alt Detail
}
}
}
By PageTS it's only possible to handle different list templates, the code must look like this:
tx_news.templateLayouts {
1 = A custom layout
99 = LLL:fileadmin/somelocallang/locallang.xlf:someTranslation
}
For different detail views you need to use TypoScript settings options.
All examples you can see here:
https://docs.typo3.org/p/georgringer/news/main/en-us/Tutorials/Templates/TemplateSelector/Index.html
I would like to group several default typo3 CE into one group.
Is it possible?
The New Content Element Wizard can be changed with Page TSconfig. For example if you want the content element type html in the first tab, you can do the following:
mod.wizards.newContentElement.wizardItems.common {
elements {
html < mod.wizards.newContentElement.wizardItems.special.elements.html
}
show := addToList(html)
}
You can add a tab and fill it with an existing element like this:
mod.wizards.newContentElement.wizardItems.myTab {
header = My tab
elements {
html < mod.wizards.newContentElement.wizardItems.special.elements.html
}
show = html
}
To remove the existing type from its original tab, add:
mod.wizards.newContentElement.wizardItems.special.show := removeFromList(html)
More on this you can find here: https://docs.typo3.org/typo3cms/TSconfigReference/PageTsconfig/Mod.html#newcontentelement-wizarditems
My goal is to apply different navigation logic to different page types. For example shortcut type will be container (drop down list in FE, shortcut itself is dummy link), standard type - page with content that you can navigate to. So, when in FE navigation user selects page:
drop-down list appears
if (type of page in list == standard)
can navigate to page in list;
else if (type of page in list == shortcut)
GO TO drop-down list appears
I know that you can do something like this:
lib {
main-nav = HMENU
main-nav {
1 = TMENU
1 {
expAll = 1
NO = 1
NO.wrapItemAndSub = <li>|</li>
NO.stdWrap.cObject = CASE
NO.stdWrap.cObject {
key.field = doktype
default = TEXT
default {
field = title
}
# standard page type
1 = TEXT
1 {
field = title
wrap = <div>|</div>
}....
As a result you get page title wrapped with div if page type is standard.
But what do i need to do to wrap whole menu item rather then just wrapping title?
If it's just about putting the div around the whole submenu, I guess what you already got should be applied to wrapItemAndSub instead
lib {
main-nav = HMENU
main-nav {
1 = TMENU
1 {
expAll = 1
NO = 1
NO.wrapItemAndSub.cObject = CASE
NO.wrapItemAndSub.cObject {
key.field = doktype
default = TEXT
default {
value = <li>|</li>
}
# standard page type
1 = TEXT
1 {
value = <li><div>|</div></li>
}....
I think you need to combine HTML, CSS and javascript.
In the typoscript you prepare the HTML with different markup depending on page type. Then your javascript has to handle the click event in case of a shortcut page where a click should open a drop down instead of going to that page. (add eventhandler)
So you need to give javascript something to identify the shortcut pages.
With the CASE object you mentioned you can build the apropiate HTML with all neccessary information (you might use data- attributes).
For a more detailed help you need to be more specific what you want to achieve.
I am trying to create a custom menu element by using this in the Page TSConfig:
TCEFORM.tt_content {
menu_type.addItems.101 = My Menu
}
And this in Setup:
temp.my_menu = HMENU
temp.my_menu {
special = list
special.value.field = pages
1 = TMENU
1 {
wrap = <ul> | </ul>
NO = 1
NO.wrapItemAndSub = <li>|</li>
}
}
tt_content.menu.20.101 < temp.my_menu
But I get 'Oops, an error occurred!' where the menu should be.
It will render fine if I remove the Fluid includes in the template but then all the other content elements give errors.
Is there any way to have a typoscript menu element at the same time as fluid styled content?
Or if I really have to, how do I add a custom fluid menu template?
You need to move the line with the copy operation down to the bottom, otherwise the configuration is not copied, because it is not there yet.
The exception happens, because there is no rendering definition for the menu (because you never copied the configuration).
To see the real error instead of the exception, switch to the development preset in the install tool oder add the following line to your TS setup:
config.contentObjectExceptionHandler = 0
I noticed this :
TCEFORM.tt_content {
menu_type.addItems.101 = My Menu
}
as far as I know should be this :
TCEFORM.tt_content.menu_type {
types {
menu{
addItems {
101 = My Menu
}
}
}
}
I had to 'tweak' the special menus (typo3 7.6) and this worked:
Add special menu and add class="active" in TYPO3