Drupal 7 主题化视图
我创建了一个名为“事件”的视图,其中列出了所有“事件”内容类型页面,但是我想通过添加“阅读更多”按钮以及其他样式来设置列表的样式。我创建了一个名为views-view--event.tpl.php 的空白模板,现在我可以看到它已被使用,因为视图不再列出页面,而是空白的(如预期)。但是,现在如何将页面添加回来?即我可以从这里访问哪些 php 变量等?我尝试回显一个简单的 $title 但这不起作用。是否有我可以访问的全局变量?如果是这样,那是什么?我只是想复制创建模板之前视图正在执行的操作,但能够按照我希望的方式设置其样式。
I've created a views called event which lists all 'event' content type pages, however I want to style the list by adding a "read more" button as well as other styles. I have created a blank template called views-view--event.tpl.php and I can see now that this is used because the view no longer lists the pages, instead it is blank (as expected). However, how do I now add the pages back in? I.e what php variables etc can I access from here? I've tried to echo a simple $title but this doesn't work. Is there a global variable that I can access? If so, what is it? I simply want to replicate what the view was doing before I created the template but with the ability to style it how I wish.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
转到视图显示并查看“高级”列的底部。您会看到类似“主题:信息”的内容。尝试找到您的模板名称并单击它以获取其基本代码。
Go to your view display and look at the bottom of the "advanced" column. You'll see something like "Theme : Information". Try to locate your template name and click on it to get it's base code.