TYPO3多列图像缩小

时间:2013-01-30 09:48:48

标签: typo3 typoscript multiple-columns

我遇到了多列imageshrink功能的问题。

有三列布局,其中imageshrink功能(第一列)完美运行。但在我的两列布局中,收缩功能似乎有效,但imagewidth始终为450px,但如果必须为280px。有什么想法吗?

TSConfig根页:

tx_multicolumn.layoutPreset >
tx_multicolumn.layoutPreset {

# Define a unique key for the layout
twoColumnLayout {

# Backend label (path to a locallang file)
label = 2 Spalten

# Icon (file resource or a path to fileadmin)
icon = fileadmin/layout/images/multi2spalten.png

config {

  #Width of multicolumn container (px or %)
  containerMeasure = px

  containerWidth = 900

  # Number of columns(integer)
  columns = 2

  # Column measure (px or %)
  columnMeasure = px

  # Column width (integer, optionSplit)
  columnWidth = 580 |*| 280

  # Column margin (string, optionSplit)
  columnMargin = 0 20px 0 0 |*| 0 0 0 0

  # Disable auto image shrink for columns (boolean, 0)
  disableImageShrink = 0

  }
}


# Define a unique key for the layout
threeColumnLayout {

# Backend label (path to a locallang file)
label = 3 Spalten

# Icon (file resource or a path to fileadmin)
icon = fileadmin/layout/images/multi3spalten.png

config {

  #Width of multicolumn container (px or %)
  containerMeasure = px

  containerWidth = 900

  # Number of columns(integer)
  columns = 3

  # Column measure (px or %)
  columnMeasure = px

  # Column width (integer, optionSplit)
  columnWidth = 300 |*| 260 |*| 260

  # Column margin (string, optionSplit)
  columnMargin = 0 20px 0 0 |*| 0 20px 0 0 |*| 0 0 0 0

  # Disable auto image shrink for columns (boolean, 0)
  disableImageShrink = 0

  }
}
}

主要模板常量:

styles.content.imgtext.colPos0.maxW = 280
styles.content.imgtext.colPos1.maxW = 280
styles.content.imgtext.colPos2.maxW = 280
styles.content.imgtext.colPos3.maxW = 280

主要模板设置:

tt_content.image.20.maxW.cObject = CASE
tt_content.image.20.maxW.cObject {
key.field = colPos
## Normal
0 = TEXT
0.value = 280
## Left
1 = TEXT
1.value = 280
## Right
2 = TEXT
2.value = 280
## Border
3 = TEXT
3.value = 280
}

2 个答案:

答案 0 :(得分:0)

我自己找到了解决方案,但无论如何,谢谢。

以下是解决方案:

我将containerMeasure设置为%而不是px,将containerWidth设置为100.

就是这样,现在缩水效果非常好。

答案 1 :(得分:0)

请添加以下的typoscript设置:

tt_content.image.20.maxW = 280px