Keyword

Include a K2 into a module.

  • Seth Turnbull
  • Seth Turnbull's Avatar Topic Author
  • Offline
  • New Member
More
13 years 3 months ago #97524 by Seth Turnbull
Include a K2 into a module. was created by Seth Turnbull
Hello all,

 

We need to pull a K2 item into the Flexi Code plugin which we are using to load some custom search modules for Mosets Tree.

 

Due to the Mtree Search feature assigning an ItemID=161 to the search results page of all searches performed we're having to parse the cat_id out of the search_log table that Mtree uses when a search it performed.

 

Vs. writing hundreds of lines of echo code into the Flexi module I'm wondering if there is a way to call and "include" an item from K2?

 

I have the code for all of this but I don't want to bother you all with it but the basic concept is the following. 

 

1. Get the data from the table in Mtree

2. Parse the data and retrieve the catid

3. Based on the catid load a K2 item into the module.

    Something like:

    if ($catid = '78'){

       include('k2 item'); //This is where I need help

    };

Can anyone help with some sample code that would call a K2 item from with Joomla? That's where I'm stuck and haven't found much on the subject.

 

Thanks in advance!

 

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

More
13 years 3 months ago #97525 by Dylan Humphreys
Replied by Dylan Humphreys on topic Include a K2 into a module.
The code you need should be in mod_k2_content.

You could however achieve the same result utilising the code you have already and MetaMod (getting the code to return the module id of a mod_k2_content module)

 

So, setup a mod_k2_content module which points at the k2 item you want

install meta mod, and add the code you listed above into it, but instead of

include("k2 item"); you would return the module if of the mod_k2_content module

 

Then let metamod do the rest!

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


Powered by Kunena Forum