TYPO3 9.5 Introduction package - typo3

How can I get the language selection from the footer into the header area - with introduction-package in TYPO3?

The introduction-package (technically a "TYPO3 distribution") uses the extension bootstrap-package for the layout.
If you have not already you would want to define Fluid paths for overwriting certain templates: https://docs.typo3.org/p/bk2k/bootstrap-package/11.0/en-us/Configuration/TypoScript/Index.html#page-fluidtemplate.
This would add your path to the chain of Fluid directories with highest priority.
To move around the language menu you'll want to change where this partial in included (finding the partial is easy by searching for recognizable HTML-code like IDs):
Partials/Page/Navigation/Language.html
You can include it in your overwritten
Partials/Page/Navigation/Main.html like this:
<f:render partial="Navigation/Language" arguments="{_all}" />
The Partials/Page/Navigation/Main.html is just an example. You can put it where you want. But you have to make sure that the used variable languagenavigation is passed to your partial. That is done by the arguments="...". For the example given this will work because it is itself included from the main Layouts/Page/Default.html and gets also arguments="{_all}".
To learn where languagenavigation comes from have a look at Configuration/TypoScript/setup.typoscript. You'll see it being filled by a DataProcessor inside a 10 = FLUIDTEMPLATE block.
I hope that helps. Feel free to tell us how you fare :) And don't be shy to ask any further questions.

Related

Wrap H1-H6 Tags with Typo3 ParseFunc depending on the class set in RTE

I want to add inline-svgs to my h1 to h6 Tags depending on the class set in the RTE.
Example:
RTE:
<h1 class="icon--clock">Header</h1>
Output:
<h1 class="icon--clock"><svg>...</svg>Header</h1>
I've done something similar with links before, using the parseFunc Config. A method like this: https://wiki.typo3.org/External_links
Is there any way to access and split the tag and class like the link parameters through TypoScript?
I also tried using a userFunc
lib.parseFunc.userFunc = ...\MyClass->MyUserFunc
but in Params I only get the tag content, not the tag or the classes that have been set themselves.
I'm using Typo8 with the ckeditor, but I don't think that makes a difference.
Can I even do this?
How do I do this?
I know that I can alternatively add different header layouts and use the tt_content header field, because it's easier to manipulate the template there. But I'd love to know if there is a way to this in the RTE.
I think you could do it in typoscript, but that would be very complicated as you need to analyze the attributes of the Hn-tags.
A simpler method which came to mind would be: use CSS and ::before. So you can use a selector to the class to insert the matching SVG.
This also can be done with javascript but as CSS can do it it would be more efficient to use CSS.

Typo3 change how objects are rendered (typo3 beginner)

I'm fairly new to typo3 and I have an issue that i don't find an explanation on how to change it. I'm sure there are already some helpful tutorials but i have issues finding them.
I am making a website and I have already made a template for fontend and backend.
It is a very simple test template that consists only of one slider and one text element.
The slider is handmade and should have the following layout:
<section class="custom-slider">
<img src="img1.jpg">
<img src="img2.jpg">
...
</section>
Thought easy, i have my slider place in my template, just need to add plain images.
but typo3 gives me:
<section class="custom-slider">
<div id="c3" class="frame frame-default frame-type-image frame-layout-0"><header><h2 class=""></h2></header><div class="ce-image ce-center ce-above"><div class="ce-gallery" data-ce-columns="1" data-ce-images="1"><div class="ce-outer"><div class="ce-inner"><div class="ce-row"><div class="ce-column"><figure class="image"><img class="image-embed-item" src="fileadmin/_processed_/1/2/csm_slider1_c3fdcdcaf5.jpg" width="600" height="187" alt="" /></figure></div></div></div></div></div></div></div>
</section>
Now i search how i can make my own custom elements or render existing elements different. I have found a lot of tutorials but they all are based on 'Extension Builder' or 'Builder' and require a custom extention. These don't seem to work on Typo3 8.7.x. Is there a different solution or can someone give me a good tutorial link?
Thank you in advanst:)
Ps: since i will have the same problem with styled text elements i would like to ask if there is a way to declare in the themplate how different predeterment elements are rendered?
In TYPO3 8.7 (I assume) your rendering is done with FSC (fluid_styled_content), so you have to understand the mechanism of FSC to render a CE (ContentElement).
As the name suggests Fluid is used. Fluid uses different templates organized in three categories (each with it's own folder):
Layouts
Templates
Partials
The call goes to a template (in the folder 'templates') where a tag can be inserted to use a specific layout (from floder 'Layouts'). if this tag is given the rendering starts with the given layout. In the layout different sections and partials can be called. Sections belong to the template, partials need to have an own partial file (in folder 'Partials').
You can override single files from the given declaration to individulize the behaviour.
In your example you may evaluate the field layout in layout, template and partial to avoid the default wrapping of any content (your images) in different div tags.

TYPO3: category tree of tx-news, render sub-tree only if main is selected

I override Templates/Styles/TWB/Templates/Category/List.html to have the category menu behave exactly as the sidebar menu in the introduction package (submenus show only if main is selected).
If I add the static template "News Styles Twitter Bootstrap (news)" I'm almost there, it is not difficult to open the sub-categories only if the main category is selected (I need a massive amount of categories/sub-categories), but it should also be open when a sub is selected:
...
<f:if condition="{0:category.item.uid,1:category.item.uid} == {0:overwriteDemand.categories,1:category.children.{overwriteDemand.categories}.parent}">
<f:if condition="{category.children}">
<f:render section="categoryTree" arguments="{categories: category.children,overwriteDemand:overwriteDemand,class:''}" />
</f:if>
</f:if>
...
I do not know how to use {overwriteDemand.categories} as key to match the value ... can anybody point to the proper syntax
update: I tried to apply a custom ViewHelper as this post suggests, but using TYPO3 V7.6.16 got stuck with the error should be compatible with TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper:‌​:render(), so could not try working with the variable overwriteDemand.categories in another way ...
Dynamic access to variables in fluid is just possible since TYPO3 8. Check out the Whats New Slides here: https://typo3.org/download/release-notes/whats-new/ and search for "Dynamic variable name parts" in the PDF.
In TYPO3 7, the "vhs"-Extension provides a ViewHelper to do the same job but nesting a ViewHelper within an complex f:if-condition is even more difficult. If possible, try out TYPO3 8. If it's not possible you may write your own ViewHelper to solve this logical problem.

Typo3: How to disable Bootstrap Language Menu

I installed the latest Typo 3 LTS 7 Version and used Bootstrap with it. I did not enable any multilanguage stuff, nor do I want it to be displayed. How to disable the language ("Deutsch, Dansk, English") which is presented after every footer?
Thanks a lot!
OK, I found a solution.
Just add
page.theme.metasection.enable = 0
to the Template Constants.
This only disables the Language Footer.
I do not know however, how to configure it (i.e. replace the non existing language names like Dansk)
The language menu is being built in EXT:bootstrap_package/Configuration/TypoScript/setup.txt (line 40).
lib.language = COA
lib.language {
...
}
It takes the languages you have defined in the backend (database), assigns information to these and builds up the HMENU. In the default bootstrap_package configuration's case that should be the languages with the ids 0,1,2.
lib.language.20.special.value = 0,1,2
You could change the values there, or get rid of the whole section all together (so not to load it at all) depending on what you want to achieve. If you want to remove it you need to remove the references in the template itself, too.
EXT:bootstrap_package/Resources/Private/Partials/Page/Structure/Footer.html (line 21):
<div class="col-md-4 language">
<f:cObject typoscriptObjectPath="lib.language"/>
</div>
.. and from all other places you are referencing lib.language.

How to fusion two content elements? / Does an all in one content element exist?

I need a content element that cointains apsects from the "Textpic" and the "Media" content elements.
Basically I need the whole palette of input masks of the textpic CE (headline, rte text, images) plus the media tab (swf, mp4, mov) from the media content element.
This special requirements for our project comes from the need that we can only use one content element for our specific javascript content slieder. So I can not use like a Textpic and underneath a media CE. No it really has to be just one CE which can handle the textpic + the media CE stuff.
Generally I ask you: Is there already a extension, trick, modification or a framework which I can/should be use to achive that i can "fusionate" content elements? Like an "all-in-one"-content element, a multi content element?
Ps: I do not use Templavoila. My Typo3 version is 4.5
I think this is the tutorial you're looking for:
http://castironcoding.com/resources/our-blog/sp/view/single/post/reason-6-for-choosing-typo3-custom-content-elements-and-extbase-again-part-23.html
Follow step 2 and 3.
You'll also need to add a specific rendering config in Typoscript ie: tt_content._your-ce_
But it can be copied from out of tt_content.textpic and tt_content.media. You can find the expample typoscript of before mentioned CE's in: typo3/sysext/css_styled_content/static/setup.txt. Just don't alter it there, but make a copy and alter in your own file.
As you seem to only talk about reusing already exisiting fields, you really only need to change the backend interface (big keyword: "showitem"). You'll need the database names of the fields (peek into the tt_content table of some records where you know the contents), alternatively visit the module Admin Tools / Configuration, select TCA in top dropdown menu, open tt_content and columns.
Try http://blog.chandanweb.com/typo3/adding-new-fields-to-existing-typo3-tables-at-desired-location, you'll of course have to substitue tt_content for tt_news etc.
You might also want to make a new type (the above recipe is for changing a preexisitent), but I'm sorry, I'm currently out of time for explaining that. It's not very hard, though, and the castiron link by Koopa will help you on your way.
Perhaps you can wrap the content column in another div? You can use that outer div for your content slider. Now you actually use all content elements seperately, but combine then for usage.