如何在 drupal 中设置视图主题
任何人都可以帮助我了解如何主题视图。
对于创建的每个视图,我想要有不同的模板。
Can any one help me out on how to theme a view.
For each view created i want to have different templates.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
主题视图可能有些棘手,具体取决于您创建的视图类型和需要进行的更改。查看此 Views 2 简介,并确保安装高级帮助模块从视图模块本身获取views2文档(将有一个指向有关视图概述和文档的链接)编辑页面(激活高级帮助模块后)。
您还可以在此处找到一些问题/答案(例如 Drupal 6:如何快速主题化视图?),如果你搜索一下。
Theming views can be somewhat tricky, depending on the kind of views you have created and the changes you need to make. Check out this introduction for Views 2, and make sure to install the Advanced Help module to get at the views2 documentation from the views module itself (there will be a link to the documentation on your views overview and edit pages, once you activated the Advanced Help module).
You can also find some questions/answers here on SO (e.g. Drupal 6: How to quickly theme a view?), if you search a bit.
前几天我确实这样做了。我将向您提供一个简短的概述,并在稍后进行扩展。
自定义您的视图
请记住,向您呈现的主题信息是从基本到复杂(从上到下)呈现的。因此,请仔细选择您需要编辑的文件。稍后我会在这个答案中放一些图片。
希望这有帮助!干杯!
I actually did this the other day. Ill give you a brief overview and expand a little later.
To Customize Your Views
Keep in mind that the theming information presented to you is presented from basic to complex (up to down). So choose which file you need to edit carefully. Ill put up some images in this answer a little later.
Hope this helps! Cheers!
您有什么具体的目标想要完成吗?有很多方法可以对视图进行“主题化”,除非您指的是严格的 Drupal 意义上的“主题”。
就我个人而言,我只是给字段类并使用它们,如果需要的话重写输出以将变量包含为类。这比直接修改 TPL 文件更容易且更易于管理。
Is there something specific you're trying to accomplish? There's a lot of ways to "theme" a view, unless you mean "theme" in the strict Drupal sense.
Personally I just give the fields classes and use those, rewriting the output to include variables as classes if need be. This tends to be easier and more manageable than modifying TPL files directly.