【问题标题】:how to add mutilple categories in a item in joomla 2.5如何在 joomla 2.5 中的项目中添加多个类别
【发布时间】:2012-07-30 10:34:12
【问题描述】:

我正在尝试在 Joomla 中构建一个组件,我希望一个项目属于多个类别。

每当我在 xml 表单中选择 ]multiple=multiple 并提交表单时,catid 都会设置为零。

//this is the code
    <code section>

  <field
 name="catid"
 multiple="multiple"
 type="category">
<option value="0">JOPTION_SELECT_CATEGORY</option>
</field>
How do I achieve that?

Secondly where is code to insert catid values in db.
protected function loadFormData()
{
// Check the session for previously entered form data.
 $data = JFactory::getApplication()->getUserState('com_xyz.edit.xyz.data', array());
if (empty($data))
 {
  $data = $this->getItem();
   }
    print_r($data);
     return $data;
  }

谁能帮帮我...

【问题讨论】:

    标签: components joomla2.5


    【解决方案1】:

    我建议使用自定义“复选框”字段而不是“类别”字段,因为我认为它不支持“多个”值。

    我好像this thread is describing the same problem and has the solution

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-03-16
      • 2013-04-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-06
      • 2013-07-08
      • 1970-01-01
      相关资源
      最近更新 更多