主题化/构建自己的模块
我是 Drupal 的新手,想为 Drupal 7 制作自己的模块。但我不明白 drupal jet 中的主题/模板系统。因此,如果有人能帮助我,我会很高兴。我正在构建一个 Twitter 模块,用于显示带有特定 #hashtag 的最新推文。加载数据不是问题。问题是选择显示数据的最佳解决方案。我想这样显示它:
[twitterauthor_url 的链接]
[标题] 作者:[author_url]
[关闭链接]
感谢您的帮助。
twitter.install 文件:(我的自定义字段)
array( 'twitter_id' => array( 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '' ), 'author' => array( 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '' ), 'author_url' => array( 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '' ), 'published' => array( 'type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => '' ), 'title' => array( 'type' => 'varchar', 'length' => 255, 'not null' => FALSE ), 'description' => array( 'type' => 'text', 'not null' => FALSE ), 'link' => array( 'type' => 'varchar', 'length' => 255, 'not null' => FALSE ), 'image' => array( 'type' => 'varchar', 'length' => 255, 'not null' => FALSE ), ), 'primary key' => array('twitter_id'), ); return $schema; }
I'm new to Drupal and want to make my own module for Drupal 7. But i don't understand the theming / templates system in drupal jet. So i will be ready glad if some one can help me with that. I'm building a twitter module that shows the latest tweets with a certain #hashtag. Loading the data is not the problem. The problem is choosing the best solution for displaying the data. I want to show it like this:
[the link to twitter author_url]
[title] by [author_url]
[close the link]
Thanks for the help.
twitter.install file: (my custom fields)
array( 'twitter_id' => array( 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '' ), 'author' => array( 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '' ), 'author_url' => array( 'type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => '' ), 'published' => array( 'type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => '' ), 'title' => array( 'type' => 'varchar', 'length' => 255, 'not null' => FALSE ), 'description' => array( 'type' => 'text', 'not null' => FALSE ), 'link' => array( 'type' => 'varchar', 'length' => 255, 'not null' => FALSE ), 'image' => array( 'type' => 'varchar', 'length' => 255, 'not null' => FALSE ), ), 'primary key' => array('twitter_id'), ); return $schema; }
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该与 http://drupal.org/project/twitter 合作,而不是编写新模块。
You should collaborate with http://drupal.org/project/twitter instead of writing a new module.