Hello there!
I'm building a plugin where K2 add metadata from the form that works with K2 Tabs.
The xml is correct, display the fields on admin K2 item, but not how to enter my data and meta data on my php code plugin:
Any idea?
Thank you!
I'm building a plugin where K2 add metadata from the form that works with K2 Tabs.
The xml is correct, display the fields on admin K2 item, but not how to enter my data and meta data on my php code plugin:
<?php
// no direct access
defined('_JEXEC') or die ;
// Load the K2 Plugin API
JLoader::register('K2Plugin', JPATH_ADMINISTRATOR.'/components/com_k2/lib/k2plugin.php');
// Initiate class to hold plugin events
class plgK2k2seo extends K2Plugin
{
// Some params
var $pluginName = 'k2seo';
var $pluginNameHumanReadable = 'SEO Tags';
function plgK2k2seo(&$subject, $params)
{
parent::__construct($subject, $params);
}
function onK2PrepareContent(&$item, &$params, $limitstart)
{
$tags=& JFactory::getDocument();
$tags->setTitle('Hello');
$tags->setDescription('Hello 2');
//This is a test
}
}
Any idea?
Thank you!