【问题标题】:Subpage Links with image and text带有图像和文本的子页面链接
【发布时间】:2014-01-07 18:12:17
【问题描述】:

我尝试实现一个包含某些子页面的图像的页面。对于每个子页面,我都有一个单独的图像。我想为每个子页面显示适当的图像“galerie_XX.png”并在图像上方显示子页面的名称。到目前为止,我得到了:

galerielabel = HMENU
  galerielabel.special = directory
  galerielabel{
    1 = TMENU
    1.NO.stdWrap{
      wrap = <img src="fileadmin/templates/images/galerie/galerie_|.png" /> 
  }
 }

子页面是年份名称,例如 2012 年、2013 年... 此脚本将所需的图像作为链接显示给我。

我的问题是,如何在图片上方添​​加子页面的名称?

提前谢谢你。

【问题讨论】:

    标签: typo3 typoscript


    【解决方案1】:

    我建议采用不同的方法。 您可以在页面属性中添加图片。

    那么,你的菜单可能是这样的:

    lib.menu = COA
    lib.menu.10 = HMENU
    lib.menu.10 {
      10 = HMENU
      10.1 = TMENU
      10.1.NO.doNotShowLink = 1 #will remove the link altogether
      10.1.NO.before.cObject = COA
      10.1.NO.before.cObject {
        10 = TEXT
        10.field = title #title of the page, change to any field you like
        20 = IMAGE
        20.file.import = uploads/media/ #4.x style
        20.file.import.field = media
        20.file.import.listNum = 0 #use first image referenced
        20.width = 200 #set to imagesize of your liking
        30 = TEXT
        30.value = Do what you like here
      }
    }
    

    【讨论】:

      【解决方案2】:

      未经测试:页面标题应加在前面

      galerielabel = HMENU
      galerielabel.special = directory
      galerielabel{
          1 = TMENU
          1.NO.stdWrap{
            # Prepend with page.title
            prepend = TEXT
            prepend {
              field = title
              htmlSpecialChars = 1
            }
            wrap = <img src="fileadmin/templates/images/galerie/galerie_|.png" /> 
          }
       }
      

      【讨论】:

      • 非常感谢!这正是我想要的!完美运行。 :)
      猜你喜欢
      • 2012-07-06
      • 1970-01-01
      • 1970-01-01
      • 2013-04-04
      • 1970-01-01
      • 2012-08-01
      • 2018-05-17
      • 1970-01-01
      • 2018-09-06
      相关资源
      最近更新 更多