Keyword

Insert item into another item

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 11 months ago #144428 by Krikor Boghossian
Replied by Krikor Boghossian on topic Insert item into another item
Nice work Chriss.
I do think keeping this code is necessary.
// Event to display (in the frontend) the YouTube URL as entered in the category form
	function onK2CategoryDisplay(&$category, &$params, $limitstart)
	{
		$mainframe = JFactory::getApplication();
		// Get the output of the K2 plugin fields (the data entered by your site maintainers)
		$plugins = new K2Parameter($category->plugins, '', $this->pluginName);
		$output = $plugins->get('videoURL_cat');
		return $output;
	}
	// Event to display (in the frontend) the YouTube URL as entered in the user form
	function onK2UserDisplay(&$user, &$params, $limitstart)
	{
		$mainframe = JFactory::getApplication();
		// Get the output of the K2 plugin fields (the data entered by your site maintainers)
		$plugins = new K2Parameter($user->plugins, '', $this->pluginName);
		$output = $plugins->get('videoURL_user');
		return $output;
	}

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
8 years 4 weeks ago #152980 by Kostas
Replied by Kostas on topic Insert item into another item
I have the same problem. I would like to insert an item to another item. Searching I read this topic. I don't have code programming knowledge. I would like to test the Chriss code but I don't know how. I have try to install localhost the example plugin with the k2Insertitems.php. The installation was successfully but it doesn't work. Could you help me please?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 4 weeks ago #152991 by Krikor Boghossian
Replied by Krikor Boghossian on topic Insert item into another item
Nice Nickname :)
I would change the var $pluginNameHumanReadable = 'Example K2 Plugin'; to your plugin's name.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum