Keyword

SetTitle() on plugin K2 | Development Help

  • Antonio Jose Valdes Medina
  • Antonio Jose Valdes Medina's Avatar Topic Author
  • Offline
  • Junior Member
More
10 years 10 months ago #120402 by Antonio Jose Valdes Medina
SetTitle() on plugin K2 | Development Help was created by Antonio Jose Valdes Medina
Hello mates,

I am creating a plugin to define the HTML tag on the page <title> regardless, I do so in my plugin:
function onK2AfterDisplayContent(&$item, &$params, $limitstart){
	$mainframe = JFactory::getApplication();
	$plugins = new K2Parameter($item->plugins, '', $this->pluginName);
	$output =  'Test  - '.$plugins->get('Title_item');
	$document=& JFactory::getDocument();
	$document->setTitle($output);
       return $output;
}

Well, how you see, I entered "manually" the word "Test -" the result in html is <title> 'Test -' </ title> instead on my K2 template when called "K2AfterDisplayContent" shows me screen "Test - This test is" complete whole.

It's like ignore $plugins->get('Title_item') to call SetTitle, but instead, it works correctly text below in page.

I hope I explained well ... Any help?
Thank you!

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


Powered by Kunena Forum