Get rid of "csc-frame" div wrap in TYPO3 - 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 >

Related

How to make a custom content element containing header, bodytext, image from tt_content inline in TYPO3 / TCA overrides?

I want to get an array of custom content objects into my fluid template, so I can build an unordered List.
This is what I want to build:
unordered list of li elements containing image, header, bodytext
In my backend I build a custom element like this:
my custom content element with fields image, header, bodytext from tt_content
What I want to achieve is, that I have a container and in it I can have my custom content element. When expanding it, I can add header, image and bodytext. So that i basically get an array of custom content Elements that I can loop over in my fluid template.
It should look like this:
each entry should be my custom content element with image, header, bodytext when expanding.
Thanks a lot for help!
You can use the extension gridelements to create a container that can hold unlimited content elements and use its template to loop over the partial which creates your content element.
If you want to do it the TYPO3 way instead of using Grid Elements..
I see you already know how to make a custom content element. To make children within your content element you could make an extra SQL field xxx_foreign.
You need to make 2 content elements. The child you know how to make.
The TCA for the inline field of the parent and needed extra colPos in the backendLayout you can find here
Then you will need in typoscript a dataprocessor I will give an example in which the child contains assets (media). In that case you need a nested solution:
tt_content {
xxx_education_block < lib.xxxCustomContentElements
xxx_eheducation_block {
templateName = xxxEducationBlock
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
10 {
if.isTrue.field = xxx_educations
table = tt_content
pidInList.field = pid
where = xxx_foreign=###uid### AND deleted=0 AND hidden=0
orderBy = sorting
markers {
uid.field = uid
}
as = xxxEducations
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10 {
if.isTrue.field = assets
references {
fieldName = assets
}
as = assets
}
}
}
}
}
}
To add this to the content wizard:
mod.wizards.newContentElement.wizardItems.blocks {
header = Xxx blokken
after = common
elements {
xxx_education_block {
iconIdentifier = content-bullets
title = XXX - Education intro block
description = Introblock xxx
tt_content_defValues {
CType = xxx_education_block
}
}
}
show := addToList(xxx_education_block)
}
If you do a debug in Fluid you should now be able to iterate over the children and the assets of the children.

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
}
}
}

TYPO3 7.4 display categories

I'm trying to display the categories of the current page.
Because I'm not that good in TYPO3, I first tried displaying all the categories before trying to display the current one.
The following snippet somehow doesn't work.
lib.categorized_content = RECORDS
lib.categorized_content {
categories.field = selected_categories
categories.relation.field = category_field
tables = tt_content
conf.tt_content = TEXT
conf.tt_content {
stdWrap.field = header
stdWrap.typolink.parameter = {field:pid}
stdWrap.typolink.parameter.insertData = 1
stdWrap.wrap = <li>|</li>
}
wrap = <ul>|</ul>
}
This is where I got this snippet from: https://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Records/Index.html#categories
I'm using <f:cObject typoscriptObjectPath="lib.categorized_content" /> to implement it into my template.
Can someone help?
selected_categories and category_field are flexform field (as you can see from the suffix .field of the configuration property) from the Special Menu content element.
You have to replace those with the actual value.

TYPO3 TypoScript: Display a list of subpages with content on parent page

I am trying to create an archive page that displays a list of subpages, similar to WordPress but display the parent's subpages instead of posts. I want the archive page to include the following from the subpage:
Title
First image
First 150 words of regular text element
At the moment I can display a page title, but that's where I got stuck. I am placing the code in a sub template. Here is the code.
lib.portfoliolist = CONTENT
lib.portfoliolist.table = pages
lib.portfoliolist.select {
pidInList = this
}
lib.portfoliolist.renderObj = COA
lib.portfoliolist.renderObj {
stdWrap.wrap = <div class="project">|</div><hr />
10 = TEXT
10 {
field = title
wrap = <h2>|</h2>
10.typolink.parameter.field = uid
}
}
If it helps, all of the images are within the fileadmin/user_upload/ directory, and this is my page structure:
Root
Home
About
Project Portfolio
Project 1
Project 2
Blog
Contact Us
Seems like I figured it out myself, all I had to do was call for content in a separate query. For those that are looking to achieve something similar, here is the code I used to help you out.
lib.portfoliolist = CONTENT
lib.portfoliolist.table = pages
lib.portfoliolist.select {
orderBy = sorting ASC
}
lib.portfoliolist.renderObj = COA
lib.portfoliolist.renderObj {
stdWrap.allWrap = <div class="row">|</div>
stdWrap.wrap = <div class="project col-lg-6 col-md-6 col-sm-12 col-xs-12">|</div>
10 = TEXT
10 {
field = title
wrap = <h2>|</h2>
typolink.parameter.field = pages.uid
}
20 = CONTENT
20 {
table = tt_content
select {
pidInList.field = uid
selectFields = header, bodytext
orderBy = sorting ASC
}
renderObj = COA
renderObj {
30 = TEXT
30.value {
field = bodytext
wrap = <div>|</div>
}
}
}
}

how to hide a marker or content parts if no content in typo3

i got a template with a marker ###whatever### its set as TEXT and filled with .value
i need to hide or empty the marker IF one of the columns are empty (in my case the normal column colPos=0)
This is a condition preventing the display of the marker's data if there's no content in the normal (colPos=0) column.
YOUR_MARKER = TEXT
YOUR_MARKER {
# ...your definitions...
# Check whether there's any content in the column 0
if.isTrue.cObject = CONTENT
if.isTrue.cObject {
table = tt_content
select {
where = colPos=0
}
renderObj < tt_content
}
}
YOUR_MARKER obviously has to be the correct path, e.g. page.10.subparts.YOUR_MARKER.