Keyword

K2AfterDisplayTitle in category ?

  • Matthieu Brunet
  • Matthieu Brunet's Avatar Topic Author
  • Offline
  • Junior Member
More
14 years 5 months ago #75820 by Matthieu Brunet
K2AfterDisplayTitle in category ? was created by Matthieu Brunet
Hi there,
I'm tryng to add extra fields in category using the plugin system.
I succeded to add fields after the category content.
But I would like to add a fiel just after the category title.
In my plugin, i do this :
--
function onK2AfterDisplayTitle( & $category, & $params, $limitstart) {

global $mainframe;
$plugin = & JPluginHelper::getPlugin('k2', 'matiere');
$pluginParams = new JParameter($plugin->params);
$plugins = new K2Parameter($category->plugins, '', $this->pluginName);

$output = "< h3 id="sousTitre">" . $plugins->get('sous-titre') . "< /h3>" ; return $output;
}
--

And in the template, i add this line :
--
< !-- K2 Plugins: K2AfterDisplayTitle -->
< ?php echo $this->category->event->K2AfterDisplayTitle; ?>

--

after the category title.

But it doesn't work. What did I missed ?

Thanks a lot

PS : it would be great to have the ability to post pieces of code in this forum, via a "code" tag...

Please Log in or Create an account to join the conversation.

More
14 years 4 months ago #75821 by pihasurfer
Replied by pihasurfer on topic K2AfterDisplayTitle in category ?
hi there, im trying to find a way to add custom fields to a category i.e. at a category level (not "extra fields" assigned articles). thanks

Please Log in or Create an account to join the conversation.

  • Matthieu Brunet
  • Matthieu Brunet's Avatar Topic Author
  • Offline
  • Junior Member
More
14 years 4 months ago #75822 by Matthieu Brunet
Replied by Matthieu Brunet on topic K2AfterDisplayTitle in category ?
You should use the plugin system for that :
k2community.joomlaworks.gr/forum/topics/example-k2-plugin-for

pihasurfer said:hi there, im trying to find a way to add custom fields to a category i.e. at a category level (not "extra fields" assigned articles). thanks

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum