php - joomla 3.x tags in custom component fails -
running joomla 3.3.0-dev
i'm following info posted here adding tag support third-party component.
i've added content type #__content_types
table , modified table
file this:
class mycomponenttableelement extends jtable { public $tagshelper = null; // failed when protected , public public function __construct(&$_db) { parent::__construct('#__mycomponent', 'id', $_db); // add joomla tags jobservermapper::addobserverclasstoclass('jtableobservertags', 'mycomponenttableelement', array('typealias' => 'com_mycomponent.element')); //$this->_observers = new jobserverupdater($this); jobservermapper::attachallobservers($this); // failed or without line }
i added tag field in edit
template, , worked fine-- when save object following error:
save failed following error: unknown column 'tagshelper' in 'field list'
what missing? there's no other steps (besides front-end steps!) mentioned. seems need modify model info not applicable.
thanks
"this page needs copy editing" , it's true!
i follow initial steps described in page
- register 'content type' extension view(s)
- add 'observer methods' extension table class(es)
- add 'tag fields' extension edit forms
but make field tag works on custom extensions need explicit set form field value in view file of backend:
$tagshelper = new jhelpertags; $this->form= $this->get('form'); $this->form->setvalue('tags', null, $tagshelper->gettagids( $this->item->id, 'com_custom.viewname') );
in way on edit page seems work correctly.. surely exist better , more clean method, until doc page not updated, can someone!
Comments
Post a Comment