[英]Customizing Navigation Menu in SilverStripe
I asked this question in SilverStripe forum, but haven't heard in a day. 我在SilverStripe论坛中提出了这个问题,但是一天没听到。 http://silverstripe.org/customising-the-cms/show/263604#post263604 http://silverstripe.org/customising-the-cms/show/263604#post263604
I am in the process of migrating a static PHP based site + Wordpress to SilverStripe. 我正在将基于PHP的静态站点+ Wordpress迁移到SilverStripe。
In the static pages, we customize the header itself. 在静态页面中,我们自定义标题本身。 We have two types of logins. 我们有两种类型的登录名。 Customers and Affiliates. 客户和会员。
In the static site today, we do something like this: 在今天的静态站点中,我们执行以下操作:
<? require("_header_top.html"); ?>
<? if (isset($display_affiliate_link) && $display_affiliate_link == true) {
require("_header_middle_affiliate.html");
} else {
require("_header_middle.html");
} ?>
<? require("_header_bottom.html"); ?>
This is the only difference in the Navigation menu between the affiliate and customer sections. 这是会员和客户部分之间导航菜单中的唯一区别。
I tried going down the different layout path. 我尝试沿着不同的布局路径前进。 But I don't prefer it as the layouts look 99% the same except for this one. 但我不喜欢它,因为除此布局外,布局看起来保持99%相同。
I tried the following hack, which works, but I don't like it at all. 我尝试了以下技巧,但效果不错,但我一点都不喜欢。
<% if MenuTitle = Affiliate %>
<a href="/affiliate_login>affiliate login</a>
<% end_if %>
<a href="/subscriber_login>subscriber login</a>
Any suggestion on how I can achieve this more elegantly or a better recommended way to implement this? 关于如何更好地实现此目标或实现此目标的更好建议的任何建议?
Vikram 维克拉姆
I do not understand what is wrong with what you did... Other workarounds would be: 我不明白您的做法有什么问题。其他解决方法是:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.