Keyword

Problem show Custom Plugins in K2

  • Quoc Anh
  • Quoc Anh's Avatar Topic Author
  • Offline
  • New Member
More
11 years 10 months ago - 11 years 10 months ago #106910 by Quoc Anh
Problem show Custom Plugins in K2 was created by Quoc Anh
Dear all.

I wants create a plugins in K2 to get link of Jdownloads base on Example plugin K2 and jDownloads Content Plugin.
My plugins includes:
1. example.xml
<params group="item-content" addpath="/plugins/k2/example/elements">
		<param name="k2itemoptions" type="k2itemoptions" default="k2itemoptions" label="Abc" description="" />		
2. k2itemoptions.php in plugins/k2/example/elements
class K2Elementk2itemoptions extends K2Element
{
	var $name = 'k2itemoptions';
    public function fetchElement($name, $value, &$node, $control_name)
    {
		$mainframe = JFactory::getApplication();
        $db = JFactory::getDBO();
        $doc = JFactory::getDocument();
		$fieldName = $control_name.'['.$name.']';			
		$link = 'index.php?option=com_jdownloads&task=editor.insert.file&tmpl=component&e_name=text';	
		JHTML::_('behavior.modal', 'a.modal');
		$html ='';
     	  $test = '<label id="pluginsexampleJdemo_item-lbl" for="pluginsexampleJdemo_item">Liên k?t d? xem demo</label><div style="float:left;">'.
		'<input style="background:#fff;margin:3px 0;" type="text" id="k2itemoptions_name" value="Thunghiem"  disabled="disabled" />'.
            '</div><div class="button2-left"><div class="blank">'.
                    '<a class="modal-button btn" title="Chon mot duong dan"  href="index.php?option=com_jdownloads&task=editor.insert.file&tmpl=component&e_name=text" onclick="IeCursorFix(); return false;" rel="{handler: \'iframe\', size: {x: 670, y: 570}}"><i class="icon-jdownloads"></i> Insert download</a>'.
                '</div></div><input type="hidden" id="k2itemoptions_id" name="'.$fieldName.'" value="'.( int )$value.'" />';
			$html .= $test;
		echo $html;
		return $html;
    }
    public function fetchTooltip($label, $description, &$node, $control_name, $name)
    {
        return NULL;
    }
}
My problem:

Attachment not found




Please help me to solve my problem
Thanks
Attachments:

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

  • Quoc Anh
  • Quoc Anh's Avatar Topic Author
  • Offline
  • New Member
More
11 years 10 months ago #106911 by Quoc Anh
Replied by Quoc Anh on topic Re: Problem show Custom Plugins in K2
Please help me to slove this problem.
Thanks

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

More
11 years 10 months ago #106912 by Kelsey Brookes
Replied by Kelsey Brookes on topic Re: Problem show Custom Plugins in K2
I can't help solve this, but for the record I'm interested in the solution.

I'd like to be able to:

  1. Load the content plugin for one of the download managers
  2. Insert the name of the current item's category into the 'content request' being made by the plugin

I would name categories in the download manager appropriately and in sync with the item categories so that I can item automatically load the available downloads for that category.

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

More
11 years 10 months ago #106913 by Lefteris
Replied by Lefteris on topic Re: Problem show Custom Plugins in K2
Hi. It seems that your function fetchTooltip needs to return a value for the label.

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

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

More
11 years 10 months ago #106914 by dipti_j
Replied by dipti_j on topic Re: Problem show Custom Plugins in K2
Hi Lefteris Kavadas,

I also need to have some custom parameters extending the item-content group.

I tried the above solution but it does not work even when returning a value from function fetchTooltip.
The only thing that gets displayed is the first TWO characters returned by the function fetchElement!!!

K2 Version 2.6.2
Joomla! 2.5.6

Please help! I need this to work.

Regards,
Dipti

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

More
11 years 9 months ago #106915 by dipti_j
Replied by dipti_j on topic Re: Problem show Custom Plugins in K2
Hello guys!!!

I thought somebody must have already answered this thread! :ohmy:

Anyways, adding the following function to the custom parameter file WORKS!!!
Log in  or Create an account to join the conversation.