Typo3 类型3:使用系统类别包装图像

Typo3 类型3:使用系统类别包装图像,typo3,typoscript,Typo3,Typoscript,我想用css包装标准的typo3图像,包含sys_类别 像 现在尝试几天都没有成功:-(您的问题确实不清楚,但是如果您希望每个图像(例如,“文本和图片”内容元素中的图像)都用包含class属性中页面类别的div包装,您可以使用以下代码。请确保更改“pidInList”的值 tt_content.image.20.1.stdWrap.prepend=COA tt_content.image.20.1.stdWrap.prepend{ 10=文本 10.1数值= } tt_content.ima

我想用css包装标准的typo3图像,包含sys_类别



现在尝试几天都没有成功:-(

您的问题确实不清楚,但是如果您希望每个图像(例如,“文本和图片”内容元素中的图像)都用包含class属性中页面类别的div包装,您可以使用以下代码。请确保更改“pidInList”的值

tt_content.image.20.1.stdWrap.prepend=COA
tt_content.image.20.1.stdWrap.prepend{
10=文本
10.1数值=
}
tt_content.image.20.1.stdWrap.append=TEXT
tt_content.image.20.1.stdWrap.append.value=
如果页面已选中类别cat1和cat2,并且类别存储在uid 123的页面中,则此代码应导致“文本和图片”或“图片”内容元素中的每个图像都出现

<div class="**TYPO3 CATEGORIES**"><img .... ></div>
tt_content.image.20.1.stdWrap.prepend = COA
tt_content.image.20.1.stdWrap.prepend {
  10 = TEXT
  10.value = <div class="
  20 = CONTENT
  20 {
    table = sys_category
    select {
# --------------------------------------------------------------------
# --- enter the uid of the page containing your categories here
      pidInList = 123
# --------------------------------------------------------------------
      selectFields = sys_category.title AS cattitle
      join = sys_category_record_mm ON sys_category_record_mm.uid_local = sys_category.uid
# --------------------------------------------------------------------
# --- use pid here if you want the categories of the page
# --- use uid here if you want the categories of the content element
      where.field = pid
# --------------------------------------------------------------------
      where.intval = 1
      where.wrap = sys_category_record_mm.uid_foreign=|
      orderBy = sys_category_record_mm.sorting_foreign
      languageField = sys_category.sys_language_uid
    }
    renderObj = TEXT
    renderObj {
      field = cattitle
      noTrimWrap = || |
    }
    stdWrap.ifEmpty.cObject = TEXT
    stdWrap.ifEmpty.cObject.value = no-categories
  }
  40 = TEXT
  40.value = ">
}
tt_content.image.20.1.stdWrap.append = TEXT
tt_content.image.20.1.stdWrap.append.value = </div>