TYPO3 powermail define bootstrap col-md-12 - typo3

I have a TYPO3 website with latest powermail plugin.
all inputfiels got col-md-6 as css class
I want that they all have col-md-12 wheren can I change this?
Thanks

See documentation of powermail: https://docs.typo3.org/typo3cms/extensions/powermail/Faq/Index.html#how-can-i-use-responsive-columns-in-powermail
Classes can be changed via TypoScript.
For example, from the manual:
plugin.tx_powermail.settings.setup {
styles {
numberOfColumns = 2
framework {
rowClasses = row
fieldAndLabelWrappingClasses = form-group col-md-6
}
}
}

Related

Layout classes from TCEFORM not showing in bootstrap_package frontend

I'm trying to add items to the layout option in the backend, either for pages or content elements. And even when I see them in the backend, I can choose one, save and it stays saved (is there when I reload) in the frontend I keep getting "frame-default" or "layout-default" or whatever other default.
This is quite clear:
https://docs.typo3.org/m/typo3/reference-tsconfig/main/en-us/PageTsconfig/TceForm.html
And I've done this before, it is that simple. But there must be something else in my system reverting and disabling this.
I've checked the TCEFORM tsconfig on the backend (in the info module) but I don't see anything that must be causing the issue.
Is a Typo3 11.5 with a Bootrstrap template based sitepackage. What it seemed strange to me is that the only option I had in the backend before I added these new ones was "Default" not more.
#
# TCEFORM
#
TCEFORM {
pages {
layout {
altLabels {
0 = Default
1 = Product-Cards
2 = Alternative 2
3 = Alternative 3
4 = Alternative 4
5 = Alternative 5
}
addItems.150 = Alternative 150
}
}
tt_content {
layout {
altLabels {
0 = Default
1 = Product-Cards
2 = Alternative 2
3 = Alternative 3
4 = Alternative 4
5 = Alternative 5
}
addItems.150 = Alternative 150
}
}
tx_news_domain_model_news {
content_elements.disabled = 1
}
}
Bootstrap seems to have been adding this layout classes just fine in it's Layout. I haven't modify bootstrap partials, template or layouts.
<f:variable name="backgroundImageClass">{f:if(condition: backgroundImage.0, then: 'frame-has-backgroundimage', else: 'frame-no-backgroundimage')}</f:variable>
<div id="c{data.uid}" class="frame {frameSize} {frameClass} {typeClass} {layoutClass} {backgroundClass} {backgroundImageClass} {spaceBeforeClass} {spaceAfterClass}">
<div class="frame-group-container">
<div class="frame-group-inner">
Thanks
By reading the file:
bootstrap_package//Resources/Private/Layouts/ContentElements/Default.html
I saw that by default bootstrap package is not including this backend layout property in its ContentElements layouts. "frame_layout" IS there but just "layout" is not.
So I would need to overwrite this file and add it.
Why isn't it there?
So... I by overwriting it and adding this fluid variable in between this other ones is fixed.
<f:variable name="typeClass">frame-type-{data.CType}</f:variable>
<f:variable name="justLayout">frame-type-{data.layout}</f:variable> // Creating this variable and adding it between the classes.
<f:variable name="layoutClass">frame-layout-{data.frame_layout}</f:variable>
<f:variable name="backgroundClass">frame-background-{f:if(condition: data.background_color_class, else: 'none', then: data.background_color_class)}</f:variable>
<f:variable name="spaceBeforeClass">frame-space-before-{f:if(condition: data.space_before_class, else: 'none', then: data.space_before_class)}</f:variable>
<f:variable name="spaceAfterClass">frame-space-after-{f:if(condition: data.space_after_class, else: 'none', then: data.space_after_class)}</f:variable>
<f:if condition="{data.frame_class} != none">
<f:then>
<f:variable name="backgroundImageClass">{f:if(condition: backgroundImage.0, then: 'frame-has-backgroundimage', else: 'frame-no-backgroundimage')}</f:variable>
<div id="c{data.uid}" class="frame {justLayout} {frameSize} {frameClass} {typeClass} {layoutClass} {backgroundClass} {backgroundImageClass} {spaceBeforeClass} {spaceAfterClass}">
<div class="frame-group-container">
Ehm, EXT:bootstrap_package is adding a new column frame_layout to tt_content and using this in its layout. You are modifying the Core's tt_content.layout (without "frame_" prefix).
pages.layoutseems not to be supported/used by EXT:bootstrap_package

prefill search field of indexed search in TYPO3 v9

I wonder how I can prefill the search field on the new indexed_search in TYPO3 v9. In older versions i put a searchfield in the head of my site:
<form method="post" action="https//linktomysearchpage" style="margin:0;">
<input type="text" placeholder="Suche" name="tx_indexedsearch[sword]"><span class="site-search-bg">
<button type="submit" name="tx_indexedsearch[submit_button]"><i class="icon-lupe"></i></button>
When jumping from this input field to the search page with the indexed_search plugin the search field of the plugin is filled and a result list is shown.
But in version 9 this does not work anymore. Something has changed.
Any help?
Thanks!
You should not use plain html but rather the fluid templates (templates are now fluid based). Example for integrating a „header search box“ on all pages like this:
lib.searchBox = USER
lib.searchBox {
userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
vendorName = TYPO3\CMS
extensionName = IndexedSearch
pluginName = Pi2
switchableControllerActions {
Search {
1 = form
2 = search
}
}
view =< plugin.tx_indexedsearch.view
view {
templateRootPaths {
20 = EXT:sitepackage/Resources/Private/Extension/IndexedSearch/Header/Templates/
}
partialRootPaths {
20 = EXT:sitepackage/Resources/Private/Extension/IndexedSearch/Header/Partials/
}
layoutRootPaths {
20 = EXT:sitepackage/Resources/Private/Extension/IndexedSearch/Header/Layouts/
}
}
settings =< plugin.tx_indexedsearch.settings
}

Typo3 Custom filed on Content Element

Can I add a custom field to each content-element where I can add a string?
In typoscript I would be able to read this string and print it in class="" attribute is that possible?
There is the note field for each content element Can I red this in typoscript and paste it in the class attribute?
CONTENT < styles.content.get
CONTENT.renderObj.stdWrap.dataWrap=<div class="{NOTE??}">|</div>
Thanks
UPDATE:
Is something like this possible:
CONTENT < styles.content.get
CONTENT.renderObj.stdWrap {
key.field = layout
4 = TEXT
4.value = <div class="csc-default blue">|</div>
5 = TEXT
5.value = <div class="csc-default meineklasse2">|</div>
6 = TEXT
6.value = <div class="csc-default meineklasse3">|</div>
}
As to stay with a given CI it normally is no good option to enable editors to enter CSS-class names by hand. A better way would be to have a set of possible classes the editor can choose from.
This can be done if you use the already available field layout in the tt_contentrecord.
As the layoutfield is type int you might need a 'translation' to your expected class names, or you stay with numbered classes like frame-layout-1 to frame-layout-3. This is the (in FSC) build in solution and available option.
You can enhance this option and also modify it.
Enhancing the selection is done in page TSconfig:
// Adding more layouts:
TCEFORM.tt_content.layout.addItems {
4 = my special layout
5 = my other special layout
}
// Modifying layouts names:
TCEFORM.tt_content.layout.altLabels {
1 = my default layout
}
// remove items
TCEFORM.tt_content.layout.removeItems = 2,3
In FSC this field is evaluated in the layout template (Resources/Private/Layouts/Default.html) (if you also use a frame_class ????)
[...]
<div id="c{data.uid}" class="frame frame-{data.frame_class} frame-type-{data.CType} frame-layout-{data.layout}{f:if(condition: data.space_before_class, then: ' frame-space-before-{data.space_before_class}')}{f:if(condition: data.space_after_class, then: ' frame-space-after-{data.space_after_class}')}">
[...]
But you can override the Default.html file with your own, like in every fluid templating system. Just copy the original file to your own space and add the new location to the template (Layout) paths.
That could end in something like:
[...]
<div id="c{data.uid}" {f:render.section(name:'layout-selection', arguments={layout:'layout'})} ... >
[...]
<f:section name="layout-selection">
<f:switch expression="{layout}">
<f:case value="1">class="normal"</f:case>
<f:case value="4">class="special"</f:case>
<f:case value="5">class="very-special"</f:case>
<f:defaultCase>class="default"</f:defaultCase>
</f:switch>
</f:section>
based on the version of your TYPO3 the template paths of FSC can be configured like:
(up to TYPO3 7):
lib.fluidContent {
templateRootPaths {
20 = EXT:my_extension/Resources/Private/Templates/
}
partialRootPaths {
20 = EXT:my_extension/Resources/Private/Partials/
}
layoutRootPaths {
20 = EXT:my_extension/Resources/Private/Layouts/
}
}
or (since TYPO3 8): (Manual)
lib.contentElement {
templateRootPaths {
20 = EXT:my_extension/Resources/Private/Templates/
}
partialRootPaths {
20 = EXT:my_extension/Resources/Private/Partials/
}
layoutRootPaths {
20 = EXT:my_extension/Resources/Private/Layouts/
}
}
I found a solution which works for me.
tt_content.stdWrap.innerWrap.cObject = CASE
tt_content.stdWrap.innerWrap.cObject {
key.field = layout
4 = TEXT
4.value = <div class="blue"><div class="container-fluid"><div class="design">|</div></div></div>
5 = TEXT
5.value = <div class="white"><div class="container-fluid"><div class="design">|</div></div></div>
6 = TEXT
6.value = <div class="grey"><div class="container-fluid"><div class="design">|</div></div></div>
}

TYPO3 - How to get the fluid style content classes of an element via typoscript in my custom element?

I recently changed form css_styled_content to fluid_styled_content. In my custom grid element I would like to render 'Content Element Layout' to this container. After switching to FSC it's not working anymore. How to get the fluid style content classes of an element via typoscript in my custom element? I render the element purely via typoscript like this:
Right now:
<div class="row test"> ... </div>
Via typoscript:
plugin.tx_myplugin.setup.my_1col {
preCObject = LOAD_REGISTER
preCObject {
containerClasses.cObject = COA
containerClasses.cObject {
10 = TEXT
10 {
value = equal-height
fieldRequired = flexform_equalHeight
noTrimWrap = | ||
}
...
stdWrap.insertData = 1
stdWrap.trim = 1
}
containerAttributes.cObject = COA
containerAttributes.cObject {
10 = TEXT
10 {
data = register: containerClasses
noTrimWrap = | class="row test |"|
}
}
}
..
}
How to get the fluid style content classes of an element via typoscript in custom element ... e.g.?:
Goal:
<div class="row frame frame-default frame-layout-0"></div>
On TYPO3 version 8 those fields are frame_class and layout
Should something like this be sufficient?
plugin.tx_myplugin.setup.my_1col{
stdWrap.wrap= <div class="frame frame-{field:frame_class} frame-layout-{field:layout}">|</div>
insertData=1
}

How to chose the tx_news list template using TypoScript

I'm starting my "adventure" with tx_news TYPO3 extension. I created the new list template and I see it in flexform on drop down list - that is ok, but how to chose that template using only TypoScript? Is it possible?
Thanks for any help.
I figured out. Here is the solution - if you have in your template, the templateLayout with number 99 (as in tx_news tutorial) <f:if condition="{settings.templateLayout} == 99"> in TypoScript you should use this code to call the 99 layout:
lib.some_news < lib.news
lib.some_news = USER
lib.some_news {
userFunc = tx_extbase_core_bootstrap->run
extensionName = News
pluginName = Pi1
switchableControllerActions.News.1 = list
settings < plugin.tx_news.settings
settings {
categories = 7
templateLayout = 99 # your layout number
limit = 1
detailPid = 22
overrideFlexformSettingsIfEmpty := addToList(detailPid)
startingpoint = 20
list {
media {
image {
maxWidth = 588
maxHeight = 428
width = 588c
height = 428c
}
}
}
}
}
Just 3 Steps.
1) Copy tepmlate from EXT folder to web site template and add in typoscript
plugin.tx_news {
view {
# Additional template paths
templateRootPaths.110 = youPath/Templates/
# Additional partial paths
partialRootPaths.110 = youPath/Partials/
# Different template for pagination
widget.Tx_News_ViewHelpers_Widget_PaginateViewHelper.templateRootPath = youPath/Templates/
}
}
2) Copy Partials inside your new "news" template. Like copy Partial/List to Partials/Latest (for exampl)
3) Now you shood write rule fore template "youPath/Templates/List.html" or/and the same fore Detail.html (if need)
<!-- Strat template -->
<f:section name="content">
<f:if condition="{settings.templateLayout}"> <!-- if we heve Layout than include our new partitial -->
<f:then>
<f:render partial="{settings.templateLayout}/List" arguments="{news: news, settings:settings}"/>
</f:then>
<f:else>
<!-- ... default Template-->
That's all) Good luck
I do get following Error when using your script.
No value found for key "TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper->switchExpression", thus the key cannot be removed.
I've checked the manual as well (http://docs.typo3.org/typo3cms/extensions/news/Main/Tutorial/IntegrationWithTs/Index.html) and also this snipped seems not to work properly.
This possibly might fix the issue: https://forge.typo3.org/issues/59255