I just followed the part of the code from the below link that deals with the backend editing. Here is the part of the code that i changed:
www.byte-my-neck.com/j/index.php?option=com_k2&view=item&id=11:setting-a-default-category-for-k2&Itemid=4
In the file administrator/components/com_k2/views/item/view.html.php, I changed this:
$lists = JHTML::_('select.genericlist', $categories_options, 'catid', '', 'value', 'text', $item->catid);
to this:
$lists = JHTML::_('select.genericlist', $categories_options, 'catid', '', 'value', 'text', 12);
Where 12 is the category id.
I see underneath that code is where the extra fields show up , but i don't know how to edit it to make it go ahead and display the extra fields. Here is the code I am speaking of:
JTable::addIncludePath(JPATH_COMPONENT.DS.'tables');
$category = JTable::getInstance('K2Category', 'Table');
$category->load($item->catid);
$extraFieldModel = K2Model::getInstance('ExtraField', 'K2Model');
if ($category->id)
{
$extraFields = $extraFieldModel->getExtraFieldsByGroup($category->extraFieldsGroup);
}
else
{
$extraFields = NULL;
}
for ($i = 0; $i < sizeof($extraFields); $i++)
{
$extraFields[$i]->element = $extraFieldModel->renderExtraField($extraFields[$i], $item->id);
}
Do you know how to make this happen?