TYPO3 rename Appearance -> Layouts of gridelements Extension - typo3

I'm trying to rename the layout labels of the Appearance tab in a gridelements module.
I can easily change labels of standard content elements via:
TCEFORM.tt_content {
layout.types {
textpic {
altLabels {
0 = Standard
1 = Bild rechts
2 = Bild links (klein)
3 = Farbig
}
removeItems = 4, 5, 100
}
image {
altLabels {
0 = Standard
1 = kleines Bild
}
removeItems = 2, 3, 4, 5, 100
}
}}
However I'm not able to figure this out. From the documentation I got: https://docs.typo3.org/typo3cms/TSconfigReference/PageTsconfig/TceForm.html
I found something, in german, that seems to work for another extension (news) https://jweiland.net/typo3/codebeispiele/tsconfig/labels-in-flexforms-anpassen.html
There're no different labels for those layouts depending on the content of table tt_content column tx_gridelements_backend_layout, like in my example above for table tt_content and column CType.
I'd appreciate help, thanks a lot!

You can achieve this the following way:
TCEFORM.tt_content {
layout.types {
gridelements_pi1 {
altLabels.1 = Change item # change item
addItems.400 = New Item # add item
removeItems = 3 # remove item
}
}
}

Related

Typo3 Fluid Templates How to add multiple templates

I have a finished static HTML Template. I need to map it to typo3 so the content is dynamic. I followed following tutorial: https://docs.typo3.org/typo3cms/SitePackageTutorial/FluidTemplates/Index.html
This works perfectly, but now I wonder how I can change the template per site? I made template for each site i.e Gallerie.html, Contact.html and they are linked to the same Layout as Header and Footer is always the same.
How do I now tell the page About us to use the Gallerie.html?
My setup.typoscript:
page = PAGE
page {
typeNum = 0
// Part 1: Fluid template section
10 = FLUIDTEMPLATE
10 {
templateName = TEXT
templateName.stdWrap.cObject = CASE
templateName.stdWrap.cObject {
key.data = pagelayout
pagets__default = TEXT
pagets__default.value = Default
default = TEXT
default.value = Default
}
templateRootPaths {
0 = EXT:eventmanagement/Resources/Private/Templates/Page/
1 = {$page.fluidtemplate.templateRootPath}
}
partialRootPaths {
0 = EXT:eventmanagement/Resources/Private/Partials/Page/
1 = {$page.fluidtemplate.partialRootPath}
}
layoutRootPaths {
0 = EXT:eventmanagement/Resources/Private/Layouts/Page/
1 = {$page.fluidtemplate.layoutRootPath}
}
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
10 {
levels = 1
includeSpacer = 1
as = mainnavigation
}
}
}
At the Moment it loads the Default.html Template from eventmanagement/Resources/Private/Templates/Page/ on every page. I created now a second Template called Gallerie.html in eventmanagement/Resources/Private/Templates/Page/ how do I add this now to the page Gallerie in the Backend?
I don't know if it's very useful to have for (nearly) every page another template but in general that's possible. Just consider that in the root-line always that template is used that is defined on the current level or - if not existing - that, that is found first while going up the root-line.
For every additional template you've to add a section inside this snippet from above:
templateName.stdWrap.cObject {
key.data = pagelayout
pagets__default = TEXT
pagets__default.value = Default
default = TEXT
default.value = Default
}
So including the option about us the snippet could look like this:
templateName.stdWrap.cObject {
key.data = pagelayout
pagets__default = TEXT
pagets__default.value = Default
default = TEXT
default.value = Default
pagets__aboutus = TEXT
pagets__aboutus.value = AboutUs
aboutus = TEXT
aboutus.value = AboutUs
}
Additional you still have to change the TCA probably to include the options in the drop-down-button.

TYPO3 Text Media Element should get class from selected sys category

I want to reach the following:
I'm creating an new content element "text media", fill out title, text and perhaps select an image. I also created categories which I select under the tab "categories".
Now I want to integrate these selected categories in the fluid template to make it work as an javascript filter.
How can I achieve this task?
Thanks!
You can use a DataProcessor to get the category data. You need to extend the TypoScript for the textmedia element.
Category example: https://git.spooner.io/spooner/just_news/blob/master/Configuration/TypoScript/RenderingDefinitions/news_list.ts#L23
DataProcessor documentation: https://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Fluidtemplate/Index.html#dataprocessing
Here you can see the default textmedia TS, added object 30:
# Text & Media:
# Any number of media wrapped right around a regular text element.
#
# CType: textmedia
tt_content.textmedia =< lib.contentElement
tt_content.textmedia {
templateName = Textmedia
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10 {
references.fieldName = assets
}
20 = TYPO3\CMS\Frontend\DataProcessing\GalleryProcessor
20 {
maxGalleryWidth = {$styles.content.textmedia.maxW}
maxGalleryWidthInText = {$styles.content.textmedia.maxWInText}
columnSpacing = {$styles.content.textmedia.columnSpacing}
borderWidth = {$styles.content.textmedia.borderWidth}
borderPadding = {$styles.content.textmedia.borderPadding}
}
# Get categories
30 = TYPO3\CMS\Frontend\DataProcession\DatabaseQueryProcessor
30 {
put the login in...
}
}
stdWrap {
editIcons = tt_content: header [header_layout], bodytext, assets [imageorient|imagewidth|imageheight], [imagecols|imageborder], image_zoom
editIcons {
iconTitle.data = LLL:EXT:fluid_styled_content/Resources/Private/Language/FrontendEditing.xlf:editIcon.textmedia
}
}
}

how to use load_register in typo3

I begin with TYPO3 and I try to work with LOAD_REGISTER.
I've read multiple examples on the net and I want to try some tests but I'm not able to output the data from LOAD_REGISTER-variables.
Here's my code :
page = PAGE
page {
count = LOAD_REGISTER
count {
nbblocks.cObject = TEXT
nbblocks.cObject {
data = patate
}
}
10 = TEXT
10.value = register:nbblocks
10.wrap = <h1>|</h1>
}
Page only shows "register:nbblocks", which must be a basic mistake.
Thanks in advance for the help :-)
There are several problems with your code.
Firstly, the page.count = LOAD_REGISTER content object is not run before page.10 = TEXT, which means that the register you're creating is does not exist where you want to use it. This can be fixed by renaming page.count to page.10 and page.10 to page.20.
Secondly, you should set the value-key on nnblocks.cObject instead of the data-key.
Thirdly, you need to wrap registers used in the value-property of the TEXT-object in curly brackets ({register:nbblocks}), and lastly, you need to set stdWrap.insertData = 1 on the TEXT-object.
All in all, this gives you the following code:
page = PAGE
page {
10 = LOAD_REGISTER
10 {
nbblocks.cObject = TEXT
nbblocks.cObject {
value = patate
}
}
20 = TEXT
20.value = {register:nbblocks}
20.wrap = <h1>|</h1>
20.stdWrap.insertData = 1
}

Get rid of "csc-frame" div wrap in TYPO3

Here is my code:
lib.navigation{
10 = RECORDS
10 {
source = uid
tables = tt_content
}
}
Here I'm just creating a menu through content element and I wanted to remove the default div with class=csc-frame csc-frame-frame1 from the rendered content
I used like this:
lib.navigation{
10 = RECORDS
10 {
conf.tt_content.stdWrap.innerWrap.cObject.default = TEXT
source = uid
tables = tt_content
}
}
but this will remove only csc_default div.
This might do the trick. Make sure to include it before the navigation definition.
tt_content.stdWrap.innerWrap.cObject.default >

HMENU with graphics

In a TYPO3 site, I have a list of sibling pages. Each page has some images in the "media" field. Im trying to make a navigation to go to the previos/next sibling. So far I have this:
# Append Sitenavi for projects
[PIDupinRootline = 43]
page.10.marks.MAIN.20 = HMENU
page.10.marks.MAIN.20{
special = browse
special{
items = next|prev
}
1 = TMENU
1{
NO = 1
}
}
[global]
But instead of using the page title, id like to use the first image from the "files" field. How could I do it?
This is the way to get other fields:
page.10.marks.MAIN.20 = HMENU
page.10.marks.MAIN.20 {
special = browse
special {
items = prev | next
}
1 = TMENU
1 {
NO = 1
NO.stdWrap.field = subtitle // title
}
}
Now if your change subtitle // title to image and add NO.stdWrap.wrap = <img src"|" />, then it should work.