Drupal 开发:我应该使用内置内容类型还是创建自己的内容类型?
我想为我的一位客户创建在线阿拉伯语-希伯来语词典,这是我第一次参与 Drupal 模块开发。如果我要在自定义 PHP 和 MySQL 中创建字典,我将创建许多数据库表并相应地执行查询。
我知道 Drupal 7 中有一个内置的内容类型,我应该使用它还是创建自己的内容类型,如果我应该创建自己的内容类型,我该怎么做?
谢谢!
I want to create an online Arabic-Hebrew Dictionary for one of my clients and this is my first experience in Drupal Module Development. If I were to create the Dictionary in custom PHP and MySQL, I would create a number of database tables and do my queries accordingly.
I know that there is a built-in content type in Drupal 7, should I use it or create my own content type, If I should create my own content type, how can I do it ?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
内置的内容类型将为您提供标题和正文,您还可以使用分类法以获得更具体的查询。
创建您自己的内容类型将取决于您的网站结构。如果上述内容足够,只需使用或修改内置内容类型,否则创建您自己的内容类型。
我的建议是您尝试使用 Drupal,观看各种教程,然后决定最适合您的要求的结构。
你的问题很模糊,对于Drupal初学者来说有很多资源,你首先通过查看教程会得到更详细的答案。
The built in content type will give you a Title and a Body, you can also use taxonomies in order to get more specific queries.
Creating your own content type will depend on your site structure. If the above is sufficient, simply use or modify the built in content types, otherwise create your own.
My advice would be for you to experiment with Drupal, watch various tutorials, then decide on the structure that would be best fit your requirements.
Your question is very vague, there are a lot of resources out there for Drupal beginners, you'll get a more detailed answer by checking tutorials first.
我相信这取决于情况。一般来说,最好尽可能地基于现有的内容类型。但是,如果您确定基于预先存在的内容类型来构建以获得问题的最佳解决方案会太尴尬/不方便,那么您应该以编程方式在模块中创建自己的内容类型。
无论您选择哪种路径,请确保正确记录您的内容类型结构,以便每当您或其他人必须使用该模块时,他们都会准确地知道每个字段的用途、任何依赖项等。
I believe that it depends. It generally is better to build upon the existing content types as much as you can. But if you determine that it would be too awkward/inconvenient to build upon the pre-existing content types in order to get the best solution to your problem, then you should programmatically create your own content type in your module.
Whichever path you choose, make sure that you properly document your content type structure, so that whenever you or someone else has to use that module, they will know exactly what each field is being used for, any dependencies, etc.