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

 
Paypal ra mắt ứng dụng Facebook cho phép chuyển tiền sang bạn bè

Paypal ra mắt ứng dụng Facebook cho phép chuyển tiền sang bạn bè

Mới đây PayPal đã công bố một ứng dụng Facebook cho phép bạn có thể gửi tiền cho bạn bè.

New Samsung TV Ad Takes a Stab at iPhone Users

New Samsung TV Ad Takes a Stab at iPhone Users

Apple and Samsung have been involved in quite the court battle over the last 6 months. Apple accused Samsung of copying the trademarked design of its products, and since then, the two companies have been in and out of court.

7 Chi tiết cần được pin đầu trang Timeline [Facebook Page]

7 Chi tiết cần được pin đầu trang Timeline [Facebook Page]

Một trong những tính năng thông minh nhất của Timeline dành cho thương hiệu, đó là Pin.

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

 

Diet con trung