Customize display và form modes trong Drupal 8

Customize display và form modes trong Drupal 8

Last week as I was looking over the Drupal 8 landing page on Drupal.org, I noticed a section titled "Customize display and form modes" and my curiosity was piqued. I fired up an instance of Drupal 8 on Simplytest.me to take a look. After a bit of poking around, and a little bit of confusion, I sorted out what this new feature means for us. It's a pretty neat thing, but let me start by explaining the roots of this in Drupal 7, with the concept of "view modes."

You may not know what these are called in Drupal 7, but if you've ever made a node look different in the teaser view from the full node view, you've used view modes. When you go to the "Manage display" tab on a content type you can see some sub-tabs in the upper right corner. These are Drupal 7 view modes, and they let you change how a piece of content looks when viewed in different contexts. You can modify what appears in the sub-tab list by toggling a list in the "Custom Display Settings" at the bottom of the screen. You can extend and do more modification to this system in Drupal 7 using a module called Display Suite. (You can find out more about that in Drupal 7 with this free Display Suite video series.)

Customize display và form modes trong  Drupal 8

Now in Drupal 8 you have more control over defining the display modes available right in core, and you can do a similar thing for the form version (where people input data) versus the display version (where people see the finished result). You can manage these settings in a new administrative section under Structure called "Display Modes." You can create or modify the existing view modes that come with core. You can also work with form modes for the form side of things. When it comes to using your new display modes, you still access them in the same place, but you have an additional tab in Drupal 8. In Drupal 7 you have both the field and the field widget on the "Manage fields" tab of a content type. Now this has been broken into two tabs: "Manage fields" and "Manage form display." This gives you more flexibility over how things will appear when someone is looking at the form. The "Manage display" tab is still the same as it was in Drupal 7. In addition to content types, you can also manage view modes for users, taxonomy, comments, and custom blocks. Right now you can only manage form modes for users.

To see what all of this looks like, here's a quick video I recorded of me playing around with this new setup in Drupal 8.

Tags: 
Bạn thấy bài viết này như thế nào?: 
No votes yet
Ảnh của Tommy Tran

Tommy owner Express Magazine

Drupal Developer having 9+ year experience, implementation and having strong knowledge of technical specifications, workflow development. Ability to perform effectively and efficiently in team and individually. Always enthusiastic and interseted to study new technologies

  • Skype ID: tthanhthuy

Tìm kiếm bất động sản

 

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
14 điều tuyệt vời khó quên khi làm việc tại Google

14 điều tuyệt vời khó quên khi làm việc tại Google

Google luôn có nhiều điểm nhấn mà nhân viên chẳng thể tìm thấy tại bất kỳ đâu.

Hướng dẫn set Your Performance Page trong Drupal 7

Hướng dẫn set Your Performance Page trong Drupal 7

When Drupal comes out of the box, it's configured for ease of development – not performance

Android 2.3 Gingerbread vượt lên dẫn đầu thị trường Android

Android 2.3 Gingerbread vượt lên dẫn đầu thị trường Android

Vào đầu tháng 10, thị phần của Android 2.3 Gingerbread chỉ chiếm khoảng 40% trong thị trường Android và xếp thứ hạng 2.

Công ty diệt chuột T&C

 

Diet con trung