https://antibiotiqueaugmentin.com/surdosage-augmentin-bebe/
× This is the optional Forum header for the Suggestion Box.

K2 WHERE parameters

  • skosch
  • skosch's Avatar Topic Author
  • Visitor
  • Visitor
12 years 2 months ago #1660

I am running K2 and would like to use Tools JX as well. My problem is that the WHERE expressions defined in Tools JX ('@article_id', '@category_id' in particular) look to the Joomla Core article and category ids that have been replaced by the K2 core.


The following script allows me to return the article id for K2 articles...

echo JRequest::getInt('id');

but I do not know how to pass it to Tools JX (or use it in the Where clause in tools jx maybe?)

I'm a noob to PHP and Joomla but I feel like I'm on the right track. I just need to know how to pass my K2 article IDs to Tools JX to display DB content relative to the page I'm on.

Any help is appreciated

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

More
12 years 1 month ago #1665

Hi,

In plugin/content/displaygrid.php on line 99

$session->set($id, $row);
the current article and its properties are saved into session.

in components/com_grid/GridBuilder.php on line 78
$this->parentCont = $session->get($id);
article properties are read fro session.

on line 475 in the sme file
$whereCond = str_replace('@article_id', $contentId, $whereCond);
the string '@article_id' is replaced with current article's ID

You should add something similar, to get your K2 article ID working.

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

Moderators: tomaz
Time to create page: 0.130 seconds

Contact Us

Contact us on Discord

Contact us on Facebook