简体   繁体   English

Drupal 7:通过自定义方法显示自定义内容类型

[英]Drupal 7: Display custom content type by custom method

Hi to all i have a content type named as "clients" i want to display them by custom method to manage their display like to manage display of thumbnail, title, content, and other custom fields on required places to keep look of design. 大家好,我有一个名为“客户”的内容类型,我想通过自定义方法来显示它们,以管理其显示,例如管理缩略图,标题,内容以及其他自定义字段在所需位置上的显示,以保持外观。 is there anyway to display custom content type data/listing by some php loop and access its title, content and custom fields to show them on my own choice instead of raw listing of items. 无论如何,是否有通过一些php循环显示自定义内容类型数据/列表,并访问其标题,内容和自定义字段以我自己的选择显示它们,而不是原始项目列表。

Thanks. 谢谢。

If you have some experience theming, and you need to do more than the "manage display" tab lets you, then you could create a custom theme that will apply just to the content type you specify. 如果您有一些主题化的经验,并且除了“管理显示”选项卡所能做的之外还需要做更多的事情,那么您可以创建一个自定义主题,该主题将仅应用于您指定的内容类型。

You'll want to create a template: node-[type].tpl.php where [type] is your content type. 您将要创建一个模板: node-[type].tpl.php ,其中[type]是您的内容类型。 Check out node.tpl.php to get a feel for how it works. 查看node.tpl.php,以了解其工作原理。

Here's some info on theming nodes: https://drupal.org/node/17565 以下是有关主题节点的一些信息: https : //drupal.org/node/17565

This will give you total control but also requires knowing or learning how to theme (which you could get started with here: https://drupal.org/documentation/theme ). 这将使您有完全的控制权,但也需要了解或学习如何主题化(可以从这里开始: https : //drupal.org/documentation/theme )。

There are different ways of doing it one as @kayakdave as said, however if you are not comfortable with it you can use 如@kayakdave所述,有多种方法可以使用,但是,如果您不满意,可以使用

Drupal 7 module Display Suit https://drupal.org/project/DS Drupal 7模块展示服https://drupal.org/project/DS

You can check the DS resources here https://drupal.org/node/1857540 您可以在此处查看DS资源https://drupal.org/node/1857540

You can also use views and panels modules to create the layout as you wish. 您还可以根据需要使用视图和面板模块创建布局。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM