简体   繁体   English

tt_news单视图中的默认图像

[英]tt_news default image in single view

In tt_news, how can I display a default image when there are no images associated with the news? 在tt_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? 我猜在“ displaySingle”和“ image”之间缺少一个点?

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. 文件路径必须正确,图像文件必须存在,否则Typo不会显示任何内容。

plugin.tt_news.displaySingle.image.noImage_stdWrap {
    cObject = IMAGE
    cObject {
        file = fileadmin/tt_news/default_image.jpg
        wrap = |
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM