Friday, May 18th

Last update01:16:07 AM GMT



  • Create an account
    *
    *
    *
    *
    *
    Fields marked with an asterisk (*) are required.

แก้ไข หน้าแสดงผล Category layout แบบ blog ของ FLEXIcontent

category_itemsเนื่องจากต้องการให้ plugin content ที่ใช้งานกับเนื้อหาจอง Joomla! ได้ มาทำงานกับการแสดงผลของ แก้ไข หน้าแสดงผล FLEXIcontent ในหน้าที่แสดงแบบ blog ได้

ซึ่งครั้งแรกที่เราต้องการให้พวก plugin นั้นทำงานได้ ต้องไปที่หน้า Components > FLEXIcontent เลือกไปที่ลิงก์ Fields

จากนั้นเลือกไปที่ลิงก์ Description เพื่อทำการแก้ไข parameter ให้มองทางขวามือ ชุดตัวเลือก Field specific properties ให้ตั้งค่าโดยเลือเปิดการทำงาน Trigger content plugins เป็น Yes และช่อง Specific plugins only ก็เลือกชื่อของ plugin ที่ต้องการให้มาทำงานครับ ถัดไป เป็นการแก้ไข จากการเรียกการแสดงผลข้อมูล Introtext มาแสดง โดยจากเดิม ระบบจะสามารถกรองคำ และตัดคำได้ ซึ่งเราต้องปิดการทำงานของ Categories นั้นก่อน
ให้ไปที่หน้า Categories เลือก Categories ที่ต้องการใช้งาน จากนั้นมองทางขวามือ เลือกชุด Parameters : standard โดยให้เปลี่ยน Category layout ให้เป็น blog
จากนั้น Layout parameters ที่อยู่ด้านล่าง จะทำงาน ชุด Parameters : blog ซึ่งจะมีอยู่ 2 ชุด การตั้งค่า คือ Leading items กับ Intro items จะมีตัวเลือก Strip html tags ให้เลือกเป็น No และ Use image เป็น No

ถัดไป คือการแก้ไขโค้ดที่ระบบเอาไปแสดงผล ซึ่งเป็นเทมเพลตของหน้า blog ของ FLEXIcontent
ซึ่งไฟล์จะอยู่ที่

/components/com_flexicontent/templates/blog/category_items.php

โค้ดจะอยู่ประมาณบรรทัดที่ 395 จาก
echo $items[$i]->introtext;
ให้ comment เอาไว้ครับ โดยใส่ // หน้าบรรทัด และใส่บรรทัดใหม่ลงไป เป็น
echo $items[$i]->fields['text']->display;

 

จากที่ใช้งาน OK ครับ.
busy

แก้ไขล่าสุด ใน วันอังคารที่ 15 มีนาคม 2011 เวลา 19:14 น.

Joomla!® Thai Community

The Joomla!® name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
Joomla.or.th is not affiliated with or endorsed by Open Source Matters or the Joomla!® Project
You are here Article Extensions แก้ไข หน้าแสดงผล Category layout แบบ blog ของ FLEXIcontent