添加块以显示最近的捐赠列表
我有一个成熟的开源软件项目,并且我很幸运能够得到用户的捐赠。我的网站使用 Drupal (6.19),我想添加一个显示最近捐赠列表的块,例如:
感谢您支持 OpenSTV
约翰·史密斯 $5 12/20/2010
玫琳凯 $20 12/5/2010
Ingwe Malmstein $50 11/27/2010
我从未在 Drupal 中做过任何自定义工作,但我的想法是:
- 创建一个名为 Donation 的自定义内容类型,它只有一个标题(已经这样做了)
- 创建一个新的 Donation 条目对于每笔捐款(也这样做了)
- 创建一个显示最近 5 笔捐款的块
- 让该块出现在侧边栏中(知道如何执行此操作)
我不知道如何编写 3 的 php 代码。有没有一个简单的我可以复制类似的事情的例子?或者是否有完全不同的方法可以更好地做到这一点?
我从来没有写过任何 php 代码,所以越简单越好。任何帮助将不胜感激。
I have an established open-source software project, and I've been fortunate enough to get donations from users. My website uses Drupal (6.19) and I'd like to add a block that shows a list of recent donations, e.g.:
Thank you for supporting OpenSTV
John Smith $5 12/20/2010
Mary Kay $20 12/5/2010
Ingwe Malmstein $50 11/27/2010
I've never done any custom work in Drupal, but my idea to do this was to:
- Create a custom content type called Donation that has only a title (did this already)
- Create a new Donation entry for each donation (did this too)
- Create a block that shows the 5 most recent donations
- Have the block appear in the sidebar (know how to do this)
I don't know how to write the php code for 3. Is there a simple example of doing something like this that I could copy from? Or is there entirely different way of doing this that would work better?
I've never written any php code so the simpler the better. Any help would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用视图模块。以下是关于它的引用(来自其项目页面):
Use the Views module. Here is a quote about it (from its project page):