简体   繁体   English

如何在TYPO3中处理图像宽度/高度?

[英]How to process image width/height in TYPO3?

I built a website in plain html/css with my own design. 我用自己的设计用简单的html / css建立了一个网站。 Now I need to put this website in TYPO3 CMS 9.5.4. 现在我需要把这个网站放在TYPO3 CMS 9.5.4中。 Unfortunately it's my first time working with TYPO3 and I don't really know what I'm doing. 不幸的是,这是我第一次使用TYPO3,我真的不知道自己在做什么。

What I got so far: 到目前为止我得到了什么:

Most of the website is already working fine. 大多数网站已经正常运作。 I included fluid_styled_content and my setup basically looks like this: 我包括fluid_styled_content,我的设置基本上是这样的:

page = PAGE
page.1 = FLUIDTEMPLATE
page.1 {
  file = fileadmin/sitedesign/Resources/Private/Templates/Page.html
  variables {
    content < styles.content.get
  }
}

The Page.html file is basically my whole html template and I put Page.html文件基本上是我的整个html模板,我把它

{content->f:format.raw()}

where I want my content. 在哪里我想要我的内容。

All content I create in the backend is displayed as I want except of images. 我在后端创建的所有内容都显示为我想要的图像除外。

My question: 我的问题:

I can display images by creating a "Text & Images" content element and adding the images in the "Images" tab. 我可以通过创建“文本和图像”内容元素并在“图像”选项卡中添加图像来显示图像。 In the "Media Adjustments" section I can now set the width and height of each element and below I can choose the number of columns. 在“媒体调整”部分,我现在可以设置每个元素的宽度和高度,下面我可以选择列数。

However these do not change anything in the source code of my website ie in the content variable, so all images are displayed in full size. 但是这些不会改变我网站的源代码中的任何内容,即内容变量,因此所有图像都以完整大小显示。

What can I do to make the width/height appear in the source code (ideally as width/height attribute of that element)? 我该怎么做才能使宽度/高度出现在源代码中(理想情况下是该元素的宽度/高度属性)?

Hey Erik and welcome to TYPO3. 嘿Erik,欢迎来到TYPO3。 Usually TYPO3 will take care of the correct images sizes when using the default Content Elements (eg Text & Images). 通常,TYPO3在使用默认内容元素(例如文本和图像)时会处理正确的图像大小。 But TYPO3 requires ImageMagick or GraphicsMagick installed on the server to modify the pictures. 但TYPO3需要在服务器上安装ImageMagick或GraphicsMagick来修改图片。 You can check out if your system matches all requirements using the "Environment" module in the TYPO3 backend (modules on the left side of the backend). 您可以使用TYPO3后端中的“环境”模块(后端左侧的模块)检查您的系统是否符合所有要求。 Then you will see a function called "Image processing" which will test the required image functions of your server. 然后,您将看到一个名为“图像处理”的功能,它将测试服务器所需的图像功能。

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

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