3 cách sắp xếp lại các fields trong Drupal

3 cách sắp xếp lại các fields trong Drupal

With all the software we teach, some tasks almost always confuse beginners.

With Drupal, re-ordering fields is one of those confusing tasks.

Learning how to re-order Drupal fields is easy. You can re-order fields using an easy drag-and-drop interface.

What's confusing is learning where to re-order fields.

By default, there are 3 ways to re-order Drupal fields and none of them are easily marked.

In this tutorial, we'll show you both how and where to re-order your fields.

The 3 Ways to Re-order Drupal Fields

Go to Structure > Content types > Manage fields.

You'll be able re-arrange the fields using the cross symbols on the left.

In this example, we've re-arranged our Article fields so that the order is Title, Tags, Image, Body.

3 cách sắp xếp lại các fields trong Drupal

When you click on Add content, you'll now see that the fields are ordered as you arranged them: Title, Tags, Image, Body.

media_1364307718297.png

However, when you save the article, the order isn't how you set it up. The order is now Title, Image, Body, Tags.

media_1364307737456.png

So what happened?

The confusion arises because the "Manage Fields" tab only controls the submission form.

To re-order how your fields appear to visitors, go to Structure > Content types > Manage display.

media_1364307769804.png

The Manage display area here is where you can re-order how your fields appear to visitors.

Change the order to Tags, Image, Body ...

media_1364307813179.png

... and that order will show to your visitors as in the image below.

However, note that you can't change the Title. To do that, you would need to use a technique like this to replace the default Title field with fields that you create.

media_1364307837818.png

Note also that the change we made in the Manage display area doesn't change the order of fields on the frontpage or blog pages. On those pages, the order remains Image, Body, Tags.

media_1364307866544.png

To change the order of fields on the frontpage or blog pages, go to Structure > Content types > Manage display and click the Teaser tab in the top-right corner.

media_1364307886217.png

Recap

So, a quick summary of how to re-order fields in Drupal:

  • Re-order fields on the submission form: Structure > Content types > Manage fields
  • Re-order fields on a page where one article is shown: Structure > Content types > Manage display
  • Re-order fields when a multiple articles are shown: Structure > Content types > Manage display > Teaser

If you need more control over the order and layout of your fields, consider using Display Suite. We have a tutorial and full training class on how to use Display Suiite.

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

 
16 cách quảng cáo tiết kiệm chi phí

16 cách quảng cáo tiết kiệm chi phí

Bạn có thể in kèm theo những thông tin đặc biệt về sản phẩm, dịch vụ hay khuyến mãi trong cửa hàng hay hệ thống cửa hàng của bạn.

Tại sao và làm như thế nào với RESTful API trong Drupal năm 2015

Tại sao và làm như thế nào với RESTful API trong Drupal năm 2015

Ok, so what’s different about Headless Drupal in comparison to standard ‘vanilla’ Drupal? From the website visitor’s

Yahoo giới thiệu khung ứng dụng web Mojito

Yahoo giới thiệu khung ứng dụng web Mojito

Yahoo cho biết khung ứng dụng web Mojito giúp giải quyết vấn đề phân phối nội dung đến các thiết bị di động có kết nối yếu hoặc thường bị gián đoạn.

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

 

Diet con trung