简体   繁体   English

TYPO3:在HMENU中使用URL别名

[英]TYPO3: Using URL Alias in HMENU

I have a page tree structure in my TYPO3 project with a page called 'main' which has three subpages. 我的TYPO3项目中有一个页面树结构,其中有一个名为“ main”的页面,该页面包含三个子页面。 In addition to it's unique pageID I gave the page 'main' a unique URL Alias 'mainalias'. 除了唯一的pageID之外,我还为页面“ main”赋予了唯一的URL别名“ mainalias”。

I can use the alias to add a link to the page 'main' eg in using 我可以使用别名添加到页面“ main”的链接,例如使用

<f:link.page pageUid="mainalias">some text</f:link.page>

in a template.html or in TypoScript eg to add a link to an IMAGE with 在template.html或TypoScript中,例如,使用以下命令添加到IMAGE的链接

stdWrap.typolink.parameter = mainalias

But when I use the alias to define the starting point of a HMENU the menu will contain no data (I simply get in empty menu but no error message in the logs): 但是,当我使用别名定义HMENU的起点时,菜单将不包含任何数据(我只是进入空菜单,而日志中没有错误消息):

special = directory
special.value = mainalias

The menu itself works and when in the code above I use the pageID of the page 'main' instead of it's alias 'mainalias' I get a menu with the three subpages as expected. 菜单本身可以工作,并且在上面的代码中,我使用页面“ main”的pageID代替别名“ mainalias”时,得到了包含三个子页面的菜单。

Can you tell me how to use the URL Alias to define the starting point of a HMENU? 您能告诉我如何使用URL别名定义HMENU的起点吗?

The simplest and most possible answer is: It is not implemented in HMENU to use an alias. 最简单,最可能的答案是:在HMENU中,没有使用别名来实现。 :) :)

Common way to use HMENU is 使用HMENU的常见方法是

10 = HMENU
10.special = directory
10.special.value = 35, 56

A alias is not a valid value. 别名不是有效值。 But value is from data type stdWrap . 但是值来自数据类型stdWrap This should work: 这应该工作:

10 = HMENU
10.special = directory
10.special.stdWrap.typolink.parameter = mainalias

See https://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Hmenu/Index.html#special-directory 参见https://docs.typo3.org/typo3cms/TyposcriptReference/ContentObjects/Hmenu/Index.html#special-directory

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM