Drupal 二级链接首页问题
我试图让我的辅助链接(使用主链接作为源,因此是主链接的子链接)在每个页面上显示为下拉列表。但是,由于(我猜测)首页上没有活动线索,因此不会显示辅助链接。
如何设置它们以便我可以在首页上显示辅助链接?
I'm trying to get my secondary links (which are using primary links as the source, so the children of the primary links) to display as a dropdown on every page. However, since (im guessing) there is no active trail on the front page, the secondary links aren't displayed.
How do I set them so that I can display the secondary links on the front page?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您只想在首页上显示辅助链接,请不要忘记添加 if 语句,例如:
或者仅使用首页的自定义模板。
If you want to display secondary links only on frontpage, don't forget to add an if statement such as:
Or just use custom template for frontpage.
您可以使用“主题”函数将辅助链接显示到首页:
要创建下拉列表,您可以将“theme_links”函数覆盖到 template.php 文件中: http://api.drupal.org/api/function/theme_links
希望有帮助。
You can use the "theme" function to display the secondary links into your front page:
And to create the dropdown you can overwrite the "theme_links" function into your template.php file: http://api.drupal.org/api/function/theme_links
Hope it helps.
菜单块 模块将执行您所描述的操作以及更多操作。
The Menu block module will do what you're describing and a whole lot more.