“所选页面的子页面菜单,包括摘要”与页面中的第一张图片

发布于 2024-11-09 12:21:39 字数 1722 浏览 4 评论 0原文

当前状态

在网站上,我当前正在使用 Sitemap 元素的 子页面菜单(包括摘要) 变体来创建子页面列表:

子页面 1
子页面 1 的摘要

子页面 2
子页面 2 的摘要

这一切都很好,并且可以通过 TypoScript 轻松完成:

lib.somethingsomething = COA
lib.somethingsomething {
    ...
    30 < tt_content.menu.20.4
    ...
}

所需状态

我想要的是包含页面中的图像的摘要(最好是第一个 tt_content 中的第一个图像)在页面上)。就像这样:

子页面 1
[IMG-X] 子页面 1 的摘要

子页面 2
[IMG-Y] 子页面 2 的摘要

到目前为止我发现的是线程 Typo3 MailArchive 上的带有图像的子页面。但是,我没有他们使用的 DAM 扩展。但是,我可以看到 tt_content.menu.20.4 只是一个 HMENU ,其 TMENU 类型为 directory

tt_content.menu.20.4 = HMENU # "Menu of subpages to these pages (with abstract)"
tt_content.menu.20.4 {
    1 = TMENU
    1 {
        target = 
        NO {
            stdWrap.htmlSpecialChars = 1
            ATagTitle.field = description // title
            linkWrap = <dt>|</dt>
            after {
                data = field : abstract // field : descr...
                required = 1
                htmlSpecialChars = 1
                wrap = <dd>|</dd>
            }
        }
        noBlur = 1
    }
    special = directory
    special.value.field = pages
    wrap = <dl class="csc-menu csc-menu-4">|</dl>
}

有谁知道实现此目的的方法,无论是扩展、TS 片段等吗?

Current state

On a site, I am currently using the Menu of subpages of selected pages including abstracts variant of the Sitemap element to create a list of subpages:

Subpage 1
Abstract from subpage 1

Subpage 2
Abstract from subpage 2

This is all very well — and easy to do via TypoScript:

lib.somethingsomething = COA
lib.somethingsomething {
    ...
    30 < tt_content.menu.20.4
    ...
}

Desired state

What I would like is the abstract to include an image from the page (preferably the first image from the first tt_content on the page). Like so:

Subpage 1
[IMG-X] Abstract from subpage 1

Subpage 2
[IMG-Y] Abstract from subpage 2

What I have found so far is the thread subpages with image on Typo3 MailArchive. However, I do not have the DAM extension that they use. However, I can see that tt_content.menu.20.4 is just a HMENU with a TMENU of type directory:

tt_content.menu.20.4 = HMENU # "Menu of subpages to these pages (with abstract)"
tt_content.menu.20.4 {
    1 = TMENU
    1 {
        target = 
        NO {
            stdWrap.htmlSpecialChars = 1
            ATagTitle.field = description // title
            linkWrap = <dt>|</dt>
            after {
                data = field : abstract // field : descr...
                required = 1
                htmlSpecialChars = 1
                wrap = <dd>|</dd>
            }
        }
        noBlur = 1
    }
    special = directory
    special.value.field = pages
    wrap = <dl class="csc-menu csc-menu-4">|</dl>
}

Does anyone know of a way to achieve this, be it an extension, a piece of TS etc.?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

呆头 2024-11-16 12:21:39

这是一个典型的 Typo3 预告片断,用于加载要显示的当前页面的第一张图像。您当然可以对导航元素使用类似的东西。

lib.teaser = IMAGE
lib.teaser {
  #this is the default image, for pages with no specific image add
  file = fileadmin/template/gfx/test_header1.jpg

  #if the selected page has an added image, the set this instead of the default above
  file.import.override.field = media

  #fetch image from the upload/media/ folder
  file.import.data = levelmedia: -1, "slide"
  file.import = uploads/media/

  #lock the configuration to use only the first added image
  file.import.listNum = 0
}


罗马

here's a typical Typo3 teaser snippet used to load the first image of the current page to be displayed. You sure can use something similar with navigational elements.

lib.teaser = IMAGE
lib.teaser {
  #this is the default image, for pages with no specific image add
  file = fileadmin/template/gfx/test_header1.jpg

  #if the selected page has an added image, the set this instead of the default above
  file.import.override.field = media

  #fetch image from the upload/media/ folder
  file.import.data = levelmedia: -1, "slide"
  file.import = uploads/media/

  #lock the configuration to use only the first added image
  file.import.listNum = 0
}

cu
Roman

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文