簡體   English   中英

如何在 Joomla 1.6 文章編輯器中插入自定義字段?

[英]How to insert custom field in Joomla 1.6 article editor?

我想在 Joomla 1.6 的管理區域的文章編輯頁面中插入一個自定義字段。 請看截圖。

http://screencast.com/t/vtLEBdUK

我試圖編輯myjoomlasite/administrator/components/com_content/models/forms/article.xml

我可以在文章選項字段集中引入一個字段,但不能在主編輯區域。

要在管理的文章編輯頁面中插入自定義字段,您需要在兩個文件中進行更改

  1. myjoomlasite/administrator/components/com_content/models/forms/article.xml

    添加您的字段名稱,如下面的代碼

    <field name="name" type="text" label="JGLOBAL_NAME" description="JFIELD_NAME_DESC" class="inputbox" size="30" required="true" />
  2. myjoomlasite/administrator/components/com_content/views/article/tmpl/edit.php

    添加您的 label 和輸入字段

    <?php echo $this->form->getLabel('name'); ?> <?php echo $this->form->getInput('name'); ?>

我不建議修改核心文件來實現你想要的。

您可以使用 Joomla 的 CCK(內容構建工具包)之一來創建您的內容模板。

適用於 Joomla 的最佳免費 CCK:

  1. Form2Content (我最喜歡的)
  2. K2 (最受歡迎,強烈推薦)

您可以在Joomla 擴展目錄中找到更多信息

您可以將自定義字段添加到文章組件(com_content),而無需更改此鏈接中的核心文件: http://docs.joomla.org/Adding_custom_fields_to_the_article_component

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM