You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

能否为Typo3面包屑添加stdWrap.data?日期前置实现疑问

Fixing Typo3 Breadcrumb with Preceding Date

Hey there! Let's fix that breadcrumb issue you're having. The problem with your current code is that you're using stdWrap.data directly on the HMENU, which replaces the entire menu output with the date—so your breadcrumb links get wiped out entirely.

Instead, we need to combine the date and the breadcrumb menu as separate elements, using a COA (Content Object Array) to stitch them together. Here's a working solution:

20 = COA
20 {
  # Wrap the entire breadcrumb + date in a <p> tag (adjust as needed)
  wrap = <p>|</p>

  # 1. Output the current date first
  10 = TEXT
  10 {
    data = date : d.m.Y
    # Add the separator after the date to connect to the breadcrumb
    wrap = | &nbsp; &gt; &nbsp;
  }

  # 2. Output your rootline breadcrumb menu
  20 = HMENU
  20 {
    special = rootline
    special.range = 0 | -1
    1 = TMENU
    1 {
      NO = 1
      # Add separator between breadcrumb items
      NO.allWrap = | &nbsp; &gt; &nbsp;
      # Style for the current page (remove the trailing separator)
      CUR = 1
      CUR.allWrap = |
    }
  }
}

Key Notes:

  • COA Usage: The COA lets us chain multiple content objects together—first the date text, then the breadcrumb menu. This ensures both elements render without overriding each other.
  • Date Handling: The TEXT object with data = date : d.m.Y safely pulls the current date, and we add the separator (&nbsp; &gt; &nbsp;) via wrap to match your desired format.
  • Breadcrumb Cleanup: We set CUR.allWrap = | to remove the trailing arrow from the current page, so your breadcrumb won't end with an extra >.

If you need to adjust the date format (e.g., Y-m-d instead of d.m.Y), just modify the date : d.m.Y part to your preferred format string.

内容的提问来源于stack exchange,提问作者Hans Martin

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 09:25:28