- Posts: 3
COMMUNITY FORUM
Problem show Custom Plugins in K2
- Quoc Anh
-
Topic Author
- Offline
- New Member
Less
More
12 years 5 months ago - 12 years 5 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.xml2. k2itemoptions.php in plugins/k2/example/elementsMy problem:
Please help me to solve my problem
Thanks
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="" />
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;
}
}
Attachment not found
Please help me to solve my problem
Thanks
Please Log in or Create an account to join the conversation.
- Quoc Anh
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 3
12 years 5 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
Thanks
Please Log in or Create an account to join the conversation.
- Kelsey Brookes
-
- Offline
- Elite Member
12 years 5 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:
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.
I'd like to be able to:
- Load the content plugin for one of the download managers
- 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.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
12 years 5 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.
Please Log in or Create an account to join the conversation.
- dipti_j
-
- Offline
- New Member
Less
More
- Posts: 2
12 years 5 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
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.
- dipti_j
-
- Offline
- New Member
Less
More
- Posts: 2
12 years 4 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!!!
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.