如何在面包屑导航中不显示tx:news的单个新闻页面?

huangapple go评论60阅读模式
英文:

How to not display the single news page of tx:news in breadcrumb?

问题

以下是翻译的内容:

"I would like not to display the empty news detail page in the breadcrumb.
I added the breadcrumb as explained here.
Then I disabled the "Page enabled in menus" as recommended on the same page.
But the breadcrumb still shows like:

Home > News > Single news > This is the name of the news

But it should be like this:

Home > News > This is the name of the news

Any ideas?


SOLUTION:

I am using FLUIDTEMPLATE with MenuProcessor with the following setup:

...
30 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
30 {
   special = rootline
   special.range = 0|-1
   includeNotInMenu = 0
   as = breadcrumbMenu
}

40 = GeorgRinger\News\DataProcessing\AddNewsToMenuProcessor
40 {
   menus = breadcrumbMenu
   includeNotInMenu = 0
}
...

When including includeNotInMenu = 0 and enable Page enabled in menus in the page settings of the News detail page the page itself won't be shown in the breadcrumb.

It is shown like this:

Home > News > This is the name of the news
英文:

I would like not to display the empty news detail page in the breadcrumb.
I added the breadcrumb as explained here.
Then I disabled the "Page enabled in menus" as recommended on the same page.
But the breadcrumb still shows like:

Home > News > Single news > This is the name of the news

But it should be like this:

Home > News > This is the name of the news

Any ideas?


SOLUTION:

I am using FLUIDTEMPLATE with MenuProcessor with the following setup:

...
30 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
30 {
   special = rootline
   special.range = 0|-1
   includeNotInMenu = 0
   as = breadcrumbMenu
}

40 = GeorgRinger\News\DataProcessing\AddNewsToMenuProcessor
40 {
   menus = breadcrumbMenu
   includeNotInMenu = 0
}
...

When including includeNotInMenu = 0 and enable Page enabled in menus in the page settings of the News detail page the page itself won't be shown in the breadcrumb.

It is shown like this:

Home > News > This is the name of the news

答案1

得分: 1

通常只需将详细页面更改为“不在菜单中”即可。由于面包屑也是菜单,因此不会呈现到该页面的链接。

英文:

Normally it's enough to change the detail page to not in Menu.
As the bread crumb also is a menu there will no link to that page be rendered.

答案2

得分: 1

这取决于 TYPO3 中面包屑导航的呈现方式,因为有多种方法可以实现它。在 TYPO3 中的任何标准实现模式中,默认行为是尊重“在菜单中启用页面”的标志,以便这些页面不会出现在面包屑导航中(在 TYPO3 中也称为“rootline”)。

但是有一些开关可以关闭这个行为,所以你可能需要查找它们。

  1. 如果你正在使用传统的 TypoScript 并且正在执行以下操作:
lib.rootline = HMENU
lib.rootline {
	special = rootline
    ...

请确保在此设置中没有包括 includeNotInMenu=1(请参考文档)。

  1. 或者你正在使用 FLUIDTEMPLATEMenuProcessor 来在 Fluid 中呈现你的面包屑导航:
50 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
50 {
    special = rootline
    special.range = 1|-1
    as = breadcrumbs
    titleField = nav_title // title
}

同样,设置应该是 includeNotInMenu=1,你不想要这个。

  1. 或者你正在使用 vhs 扩展和提供的 Breadcrumb ViewHelper 直接在你的 Fluid 模板中:
<v:page.breadCrumb as="menu">
   ...

在这种情况下,请确保你没有使用 showHiddenInMenu="true" 属性。

如果你的面包屑导航以其他方式呈现,你可能需要调整你的问题,以包括你代码的相关部分,以便我们可以提供更精确的答案。

英文:

It depends on how your breadcrumb is being rendered, as there are many ways to do it in TYPO3. The default in any of these standard implementation modes in TYPO3 is to respect the flag "Page enabled in menus", so that these pages do not appear in the breadcrumbs (also known as "rootline" in the TYPO3 world).

But there are switches to turn this behaviour off, so you might want to hunt for them.

  1. Either you are using straight old-school TypoScript and doing this:
lib.rootline = HMENU
lib.rootline {
	special = rootline
    ...

Make sure you have not included includeNotInMenu=1 in this setup (see docs).

  1. Or you are using a FLUIDTEMPLATE with a MenuProcessor to be able to render your breadcrumb in Fluid:
  50 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
  50 {
    special = rootline
    special.range = 1|-1
    as = breadcrumbs
    titleField = nav_title // title
  }

Also here the setting would be includeNotInMenu=1 to search for, which you don't want.

  1. Or you are using vhs extension and the provided Breadcrumb ViewHelper directly in your Fluid template:
&lt;v:page.breadCrumb as=&quot;menu&quot;&gt;
   ...

In this case, make sure you are not using the showHiddenInMenu=&quot;true&quot; attribute.

In case your breadcrumb are being rendered in any other way, you might need to adjust your question to include the relevant part of your code so that we can formulate a more precise answer.

huangapple
  • 本文由 发表于 2023年3月7日 22:33:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/75663316.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定