Drupal 多站点和一个主题:如何知道哪个多站点用户正在使用?
我安装了 drupal 多站点,并且 atm 我有两个站点。两个网站都使用相同的主题,但网站的外观之间几乎没有微小的差异(例如徽标和 div/bar 的颜色不同)。或者我希望他们会有这些差异。现在的问题是我如何知道主题模板上正在显示哪个网站?某处是否有一些参数或变量?基本上,我可以做的是简单的 php if 子句(如果是这个站点,则显示此 div,而其他站点则不显示它)?
谢谢。
I have drupal multisite installed and atm I have two sites. Both sites uses same theme, but there are few tiny differences between looks of the site (like logo and div/bar is different color). Or well I would that they would have those differences. Now the question is how can I know on theme template that which site is showing up? Is there some paremeter or variable somewhere? Basically so that I could do is simple php if clause (if its this site, show this div and its the other site dnot show it)?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我的一个项目中,我遇到了类似的问题。我所做的是在 template.php 中创建了以下函数:
然后我可以在 page.tpl.php 代码中调用它。就像
否则你可以查看块类模块。这也可能有帮助。
In one of my project I had the similar problem. What I did was that in template.php I created the following function:
And then I could call this in the page.tpl.php code. Like
Otherwise you could look into Block Classes module. That could also help.