templateDetails.xml
เพิ่ม
โค้ด: เลือกทั้งหมด
<config>
<fields name="params">
<fieldset name="advanced">
<field name="templateColor" class="" type="color" default="#08C"
label="TPL_PROTOSTAR_COLOR_LABEL"
description="TPL_PROTOSTAR_COLOR_DESC" />
</field>
</fieldset>
</fields>
</config>
เวลาเอามาใช้ในไฟล์ index.php ใน template ของเรา
โค้ด: เลือกทั้งหมด
if ($this->params->get('templateColor')){
// โค้ดคำสั่งตามความต้องการ
}
ดูตัวอย่างเพิ่มเติมได้จาก template default ของ #Joomla (protostar)