วิธีจัดการเนื้อหาปัจจุบัน ไม่ให้แสดงผลใน Drupal Views (Exclude Current Node)

ในบางครั้งจำเป็นต้องสร้าง Views รายการเนื้อหา แล้วนำมาแสดงในหน้าเพจ แล้วมันจะแสดงหัวข้อซ้ำกับเนื้อหาปัจจุบัน (Current Node) วิธีแก้ปัญหา ไม่แสดงเนื้อหาปัจจุบันใน Views ทำได้ดังนี้

1. เลือกแถบ Advanced (ขวามือ)

2. คลิกเพิ่ม (Add) ตัวเลือก Contextual filters และเลือก Content: Nid

3. ในหัวข้อ When the filter value is NOT available ให้เลือก Provide default value เป็น Content ID from URL

4. ในหัวข้อ More ด้านล่าง ให้เลือก Exclude

Drupal Views: Exclude Current Node in Views