tt_news default image in single view - typo3

In tt_news, how can I display a default image when there are no images associated with the news? I tried
plugin.tt_news.displaySingle.image.noImage_stdWrap.cObject = IMAGE
plugin.tt_news.displaySingle.image.noImage_stdWrap.cObject {
wrap =
file = fileadmin/images/image.jpg
}
but it doesn't display the image.

It should work with this:
plugin.tt_news.displaySingle.image.noImage_stdWrap {
cObject = IMAGE
cObject {
file = fileadmin/news-image-default.jpg
wrap =
}
}

i guess there is a dot between "displaySingle" and "image" missing?
plugin.tt_news.displaySingle.image.noImage_stdWrap.cObject = IMAGE
plugin.tt_news.displaySingle.image.noImage_stdWrap.cObject {
file = fileadmin/images/image.jpg
}

This code works for me. Path to file must be correct and image file must exists otherwise Typo don't display anything.
plugin.tt_news.displaySingle.image.noImage_stdWrap {
cObject = IMAGE
cObject {
file = fileadmin/tt_news/default_image.jpg
wrap = |
}
}

Related

TYPO3 meta description - Text crop

here is the normal typoscript code for the Example like the Description:
page {
meta {
description = TEXT
description {
field = og_description // description
crop = 160| |1
}
}
}
How can i add a crop for the description Text?
Thanks all
With activated EXT:seo the tags are first set by PHP and after that, the TypoScript config is handled. The TypoScript configuration does not replace existing tags by default. So tags that have been set via PHP will not be overwritten.
If you'd like to change this default behavior, you have to use replace in TypoScript configuration (-> "MetaTag API > TypoScript and PHP":
page.meta {
description = TEXT
description.value = Override the pages description
description.replace = 1
}
As Julian mentioned: if you want to modify an existing meta tag definition you need to use replace (even if you only modify the existing definition)
If you only want to crop the existing text your code should be:
page {
meta {
description {
crop = 160| |1
replace = 1
}
}
}
If you also want to change the fields you could use
(my default is description.field = description):
page {
meta {
description {
field = og_description // description
crop = 160| |1
replace = 1
}
}
}
But don't use: description = TEXT as this will set the value TEXT to the meta tag

FilesProcessor with asset filed in custom content elelemt

in the following script:
tt_content.myFCE {
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
10 {
references.fieldName = image
as = files
}
20 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
20 {
references.fieldname = assets
as = myFiles
}
}
}
the first part (index 10) works but the second (index 20) doesnt. I get an empty array. It seems that the FilesProcessor is not able to access the images which are stored in assets.
Is there a possibility to fetch the assets from the field assets?
Thanks!
Bernd Wilke wrote it in his comment: there is a typo in fieldname - it should be fieldName ... i was totaly blind, didn`t see it until his comment. What a shame ... :-) After correcting the typo all works exactly as expected.

Typo3/Typoscript: get data from (page) media ressources

I'm using Typo3 6.2.15 and want to upload some files at page->ressources->media like jpegs, mp4s, pngs...
To switch the output of the different filetypes, I tried it with the following script without success:
HEADER = CASE
HEADER {
key.data = levelmedia: -1, slide
key.listNum = 0
key.split {
token = .
returnKey = 1
}
jpg = TEXT
jpg.value = test
}
Has anybody an idea whats the problem?

Extract single Object from Object list in typoscript

Ok, the headline is bit confusing, but i didnt know, how to describe my problem in a short version. Here we go: I get a list of image-urls from the resources of one page, it works like this:
lib.slider = FILES
lib.slider {
references {
data = levelmedia:-1, slide
}
renderObj = TEXT
renderObj {
data = file:current:publicUrl
wrap = {image :'|'}
}
}
Now i want to make an image-container from each of the images. I'm not very good in typoscript so i have no idea, how to do that. I had the idea of making an array out of it and using the f:for-Viewhelper but I dont know how to get an array from this or how to access the images from html.
As an alternative to your own findings, you can modify the renderObj to be an IMAGE cObject, like the following - that way you can define dimensions of your images as well.
lib.slider = FILES
lib.slider {
...
renderObj = IMAGE
renderObj {
file {
import.data = file:current:originalUid // file:current:uid
maxW = 150
}
}
}
See the FILES documentation and IMAGE documentation for further examples.
Ok, I found a solution myself, ich just changed the wrapper to <img src="|" /> and got what i wanted

TYPO3 News extension, image upload size

Im running TYPO3 v. 6.4 Fluid/Extbase.
Im working with the News (news) Extension and it's working fine, but i have a little problem.
When i make a new news and go to Relation and add an image (800x600) then it's resize it to 100x80.
What file do I look after, so i can changes the resize, so I get the size 800x600.
Have scanned the folder for the extension and can't find any place that handle the image udload.
SETUP
plugin.tx_news {
settings {
# only for DETAILS VIEW
detail {
media {
image {
maxWidth =
maxHeight =
}
}
}
# only for LIST VIEW
list {
media {
image {
maxWidth =
maxHeight =
}
}
}
}
}
greetings
maty