Trace:
Differences
This shows you the differences between the selected revision and the current version of the page.
| joomla:add-opensearch-in-joomla-site 2009/10/30 16:39 | joomla:add-opensearch-in-joomla-site 2010/04/03 23:44 current | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| วิธีการเปิดใช้ opensearch ใหักับ Joomla มีดังนี้ | วิธีการเปิดใช้ opensearch ใหักับ Joomla มีดังนี้ | ||
| - | - สร้างไฟล์ขึ้นมาใหม่โดยใช้ชื่อว่า opensearch.xml โดยไฟล์ดังกล่าวมีข้อความดังนี้ | + | 1. สร้างไฟล์ขึ้นมาใหม่โดยใช้ชื่อว่า opensearch.xml โดยไฟล์ดังกล่าวมีข้อความดังนี้ |
| - | <nocode> | + | |
| - | <?xml version="1.0" encoding="UTF-8"?> | + | |
| - | <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> | + | |
| - | xmlns:moz="http://www.mozilla.org/2006/browser/search/" | + | |
| - | xmlns:ie="http://schemas.microsoft.com/Search/2008/"> | + | |
| - | <ShortName>NSTDA Thailand</ShortName> | + | |
| - | <Description>search in NSTDA Website</Description> | + | |
| - | <Tags>NSTDA Thailand สวทช.</Tags> | + | |
| - | <Contact>boonlert@nstda.or.th</Contact> | + | |
| - | <SyndicationRight>open</SyndicationRight> | + | |
| - | <AdultContent>false</AdultContent> | + | |
| - | <Language>th</Language> | + | |
| - | <InputEncoding>UTF-8</InputEncoding> | + | |
| - | <LongName>nstda.or.th web search</LongName> | + | |
| - | <OutputEncoding>UTF-8</OutputEncoding> | + | |
| - | <Image width="16" height="16" type="image/icon">http://www.nstda.or.th/images/favicon.ico</Image> | + | |
| - | <Url type="text/html" method="GET" template="http://www.nstda.or.th/index.php/component/search/{searchTerms}?ordering=newest&searchphrase=all&limit=20#content" /> | + | |
| - | </OpenSearchDescription></nocode> | + | |
| - | - แก้ไขไฟล์ index.php ของ template ปัจจุบัน ซึ่งถูกเรียกใช้งานอยู่ ซึ่งอยู่ใน folder /templates/template-name/ โดยเพิ่มบรรทัด | + | |
| + | <?xml version="1.0" encoding="UTF-8"?> | ||
| + | <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/" xmlns:ie="http://schemas.microsoft.com/Search/2008/"> | ||
| + | <ShortName>[Web Site Name]</ShortName> ---> ใ้ห้ระบุชื่อสั้นที่ต้องการให้ปรากฎในรายการ search engine provider บน web browser เช่น NSTDA Thailand | ||
| + | <Description>search in [Web Site Name] Website</Description> ---> ใ้ห้ระบุคำอธิบาย | ||
| + | <Tags>keyword1 keyword2</Tags> ---> ใ้ห้ระบุ keyword | ||
| + | <Contact>admin@domain.com</Contact> ---> ใ้ห้ระบุอีเมล์แอดเดรสของผู้ดูแลเว็บไซต์ | ||
| + | <SyndicationRight>open</SyndicationRight> | ||
| + | <AdultContent>false</AdultContent> | ||
| + | <Language>th</Language> ---> ใ้ห้ระบุภาษาหลักของเว็บไซต์ | ||
| + | <InputEncoding>UTF-8</InputEncoding> ---> ใ้ห้ระบุการเข้ารหัสของตัวอักษร | ||
| + | <LongName>[longer Web Site Name]</LongName> ---> ใ้ห้ระบุชื่อยาว | ||
| + | <OutputEncoding>UTF-8</OutputEncoding> | ||
| + | <Image width="16" height="16" type="image/icon">http://yourdomainname/[path to your website image icon]</Image> ---> ใ้ห้ระบุภาพไอคอนของเว็บไซต์ | ||
| + | <Url type="text/html" method="GET" template="http://yourdomainname/[path of your joomla search component]" /> ---> ใ้ห้ระบุ URL ที่ใช้ทำการสืบค้นบนเว็บไซต์ Joomla โดยที่ส่วนนี้ขึ้นอยู่กับการติดตั้งและปรับแต่งใช้งานฟังก์ชันสืบค้นใน Joomla โดยให้แทนที่คำค้นด้วยตัวแปร "{searchTerms}" เช่น url ที่ใช้ในการค้นเป็น "http://yourdomainname/index.php/component/search/[searchword]?&searchphrase=all" ให้แก้ไขเป็น "http://yourdomainname/index.php/component/search/{searchTerms}?&searchphrase=all" โดยเครื่องหมาย "&" ให้แทนที่ด้วย "&" | ||
| + | </OpenSearchDescription> | ||
| + | |||
| + | |||
| + | 2. แก้ไขไฟล์ index.php ของ template ปัจจุบัน ซึ่งถูกเรียกใช้งานอยู่ ซึ่งอยู่ใน folder /templates/template-name/ โดยเพิ่มบรรทัดต่อไปนี้ ในส่วน <head></head> | ||
| + | |||
| + | |||
| + | <head> | ||
| + | . | ||
| + | . | ||
| + | . | ||
| + | <link rel="search" type="application/opensearchdescription+xml" title="[Web Site Name]" href="<http://yourdomainname/[path of opensearch.xml]" /> | ||
| + | . | ||
| + | . | ||
| + | . | ||
| + | </head> | ||
| + | |||
| ---- | ---- | ||
| Line 33: | Line 45: | ||
| - นายขันธ์ศิริ อาทร เจ้าหน้าที่ระบบคอมพิวเตอร์ ศูนย์บริการความรู้ทางวิทยาศาสตร์และเทคโนโลยี | - นายขันธ์ศิริ อาทร เจ้าหน้าที่ระบบคอมพิวเตอร์ ศูนย์บริการความรู้ทางวิทยาศาสตร์และเทคโนโลยี | ||
| - | {{tag>joomla opensearch "search engine"}} | + | {{tag>joomla opensearch "search engine" web html}} |
