简体   繁体   English

Drupal | 动态主链接菜单

[英]Drupal | Dynamic Primary link menus

I have a primary link menu and sub menu. 我有一个主链接菜单和子菜单。 I have created it through drupal configurations. 我已经通过drupal配置创建了它。 But somehow sub menu needs to be dynamic based on contents. 但是,子菜单需要基于内容是动态的。 I have an array of menu and sub menu with title and path, this array is dynamic with time to time. 我有一个包含标题和路径的菜单和子菜单数组,该数组随时间动态变化。 I want to write a code which will delete the previously available sub menus and add the new sub menu. 我想编写一个代码,该代码将删除先前可用的子菜单并添加新的子菜单。

So basically question is how can I delete the available primary link sub menu from code and add new sub menu? 因此,基本上的问题是如何从代码中删除可用的主链接子菜单并添加新的子菜单?

I will suggest you to use token module, as it will produce a dynamic link(menu) according to your content or node. 我建议您使用令牌模块,因为它会根据您的内容或节点生成动态链接(菜单)。

Download here 在这里下载

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

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