- Posts: 5
COMMUNITY FORUM
Insert item into another item
- Chriss De Grece
-
Topic Author
- Offline
- New Member
Maybe Something like
{k2ItemID 123}
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Chriss De Grece
-
Topic Author
- Offline
- New Member
- Posts: 5
Is there any developers documentation anywhere? I downloaded the sample plugin from the extensions and it seems pretty easy to simply replace the curly braces (ID) with the fulltext of another item BUT I cannot find how to load an item the K2 way. Maybe will simply use Joomla framework queries to do it.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
- Posts: 3722
Please Log in or Create an account to join the conversation.
- Chriss De Grece
-
Topic Author
- Offline
- New Member
- Posts: 5
william white wrote: You might try the pro version of Articles Anywhere by NoNumber.nl which has support for k2
Thanks but since I already have the example k2 plugin, I will try my luck with a simple Joomla query
select fulltext from #__k2_items where id = 123
I am pretty optimistic it will work , we'll see.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
You can post it at github and let me know if you need any assistance.
Please Log in or Create an account to join the conversation.
- Chriss De Grece
-
Topic Author
- Offline
- New Member
- Posts: 5
Krikor wrote: I think a taylor made plugin would probably be the best solution for you Chriss.
You can post it at github and let me know if you need any assistance.
Thanks a lot, will do that and let you know.
Please Log in or Create an account to join the conversation.
- Chriss De Grece
-
Topic Author
- Offline
- New Member
- Posts: 5
Krikor wrote: I think a taylor made plugin would probably be the best solution for you Chriss.
You can post it at github and let me know if you need any assistance.
@Krikor
OK, I think it's done. At least it's working. It would be nice if you took a look just in case I have done something extremely stupid.
github.com/ChrissDeGrece/k2InsertItems
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
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;
}
Please Log in or Create an account to join the conversation.
- Kostas
-
- Offline
- New Member
- Posts: 2
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
I would change the var $pluginNameHumanReadable = 'Example K2 Plugin'; to your plugin's name.
Please Log in or Create an account to join the conversation.