如何在 Drupal 中最好地显示联属链接列表?
我有一个 Drupal 5 网站,我想在其中显示不同产品、销售和优惠的联属链接列表(或网格)。每个“附属产品”节点都有标题、描述、图像和 URL。单击图像或 URL 链接时,用户应被重定向到该 URL。
我已经接近这个目标,使用视图、自定义分页器并向 CCK(内容构建工具包)中的节点添加自定义图像字段,但每当单击图像时,它都会转到完整节点页面而不是 URL。
任何做过此或类似事情的人的建议将不胜感激。如果这可以在 Drupal 6 中更轻松地实现,我准备升级该站点,因为无论如何,这已经在待办事项列表中了。
提前致谢。
I have a Drupal 5 website on which I want to display a list (or grid) of affiliate links to different products, sales and offers. Each 'affiliate product' node will have a title, description, an image and a URL. When either the image or URL link is clicked, the user should be redirected to the URL.
I've gotten close to this, using a view, custom pager and adding a custom image field to my node in CCK (Content Construction Kit), but whenever the image is clicked, it goes to the full node page rather than the URL.
Any advice from people who've done this or something similar would be greatly appreciated. If this can be more easily achieved in Drupal 6, I'm prepared to upgrade the site, as that was on the to-do list anyway.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想坚持使用 Drupal 5,您可以在主题中使用视图模板(使用主题向导模块作为起点)来显式创建指向 URL 链接的图像链接。这很容易成为最快的解决方案。
如果升级到 Drupal 6,您可以使用 Views 2 中的新功能重写图像字段输出以包含链接。 Drupal 5 和 6 之间的视图和 Imagefield 之间有很多差异,所以如果您选择这条路线,请准备好接受轻微的学习曲线。
If you want to stick with Drupal 5 you can use a View template in your theme (using the Theme Wizard module as a starting point) to explicitly create an image link to the URL link. That would easily be the quickest solution.
If you upgrade to Drupal 6 you can use the new features in Views 2 to re-write the image field output to include the link. There are a lot of differences between Views and Imagefield between Drupal 5 and 6 though so be ready for a slight learning curve if you go that route.