/administrator/components/com_content/models/forms/filter_articles.xml
- เมื่อมีการเปลี่ยนแปลง form ทาง backend ตามปรกติ ค่า default ตาม id ของ article
type="list"
label="COM_CONTENT_LIST_FULL_ORDERING"
description="COM_CONTENT_LIST_FULL_ORDERING_DESC"
onchange="this.form.submit();"
default="a.created DESC"
>
หากต้องการเปลี่ยนแปลงตามความต้องการ เช่นให้เรียงตามวันที่สร้าง ให้เปลี่ยนจาก a.id เป็น a.created
/administrator/components/com_content/models/articles.php
- เมื่อ Login เข้าไปแล้วคลิกที่เมนู Content > Articles ตามปรกติ ค่า default ตาม id ของ article
// List state information.
//parent::populateState('a.id', 'desc');
ของเดิมรียงตาม id
parent::populateState('a.created', 'desc');
- //$orderCol = $this->state->get('list.ordering', 'a.id') ของเดิมรียงตาม id เปลี่ยนใหม่เป็นเรียงตามวันที่
- //$orderDirn = $this->state->get('list.direction', 'desc');
- $orderCol = $this->state->get('list.ordering', 'a.created');
- $orderDirn = $this->state->get('list.direction', 'desc');
ไม่มีความคิดเห็น:
แสดงความคิดเห็น