简体   繁体   English

TYPO3 tt_content->图片

[英]TYPO3 tt_content --> image

I've following code in my TypoScript: 我在TypoScript中遵循以下代码:

MAINCONTENT = COA
MAINCONTENT.10 = CONTENT
MAINCONTENT.10{
    table=tt_content
    #select.where = uid=5
    select.pidInList = 33
    renderObj = COA
    renderObj {
        10=TEXT
        10.value = <div class="news">

        20=IMAGE
            20{
                required=1
                file.import=fileadmin/images/
                file.import.field=image
                file.width=170
                file.height=100
            }
        20.wrap = <div class="news_image">|</div><div class="news_content">

        30=TEXT
        30.field=crdate
        30.date = d.m.Y
        30.wrap=<div class="news_content"><div class="news_datum"> | </div>

        40=TEXT
        40.value=<div class="news_rubrik"><strong>Rubrik:</strong> testrubrik</div>

        #stdWrap.outerWrap = <div id="article">|</div>
        50=TEXT
        50.field = header
        50.wrap=<div class="news_headline"><a> | </a></div>

        60=TEXT
        60.field=bodytext
        60.wrap=<div id="content_text"> | </div></div><div class="cf"></div></div><div class="newstrenner"></div-->

        70=TEXT
        70.value = </div>
    }
}

My question is about the 20 - IMAGE Object. 我的问题是关于20-IMAGE对象。

How can i get the image - which is uploaded by an editor - from the tt_content ? 我如何从tt_content获取由编辑者上传的图像?

Is the tt_content maybe the wrong table ? tt_content可能是错误的表吗?

Welcome to TYPO3 :-). 欢迎来到TYPO3 :-)。 If you want to do TYPO3 a favor, spell it as I spelled it 8 words ago :-). 如果您想帮TYPO3帮忙,请像我在8个单词前拼写它一样拼写它:-)。 As for your code, it's going to the right direction. 至于您的代码,它将朝着正确的方向发展。 I assume you're using TYPO3 4.x since quite some things changed in image handling with TYPO3 6.0 (and the introduction of the File Abstraction Layer). 我假设您正在使用TYPO3 4.x,因为使用TYPO3 6.0(以及文件抽象层的引入)在图像处理方面发生了很多变化。

For getting the first image of the content, you can use the following code: 要获取内容的第一张图片,可以使用以下代码:

20 = IMAGE
20 {
  required=1
  file.import = uploads/pics/
  file.import.field = image
  file.import.listNum = 0
  file.width=170
  file.height=100
}

Since all pictures attached to a content element are copied to uploads/pics in TYPO3 4.x, you must indicate this path. 由于附加到内容元素的所有图片均已复制到TYPO3 4.x中的上载/图片中,因此您必须指明此路径。

listNum = 0 tells TYPO3 to take the first picture. listNum = 0告诉TYPO3拍摄第一张照片。 A tt_content can hold multiple images that are stored comma-separated in the database. tt_content可以保存以逗号分隔存储在数据库中的多个图像。

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

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