I have a form created with RSForm Pro and I am loading this form in some K2 items with the RSForm Content Plugin.

I want to get the title of k2 item that form submitted from it. in k2 item view I solve this problem with this code.

$K2Itemid = JRequest::getInt('id');$db = JFactory::getDBO();$db->setQuery("SELECT title FROM #__k2_items WHERE id = ".$K2Itemid );$K2Catid = $db->loadResult(); return $K2Catid;

but what is solution in category blog view of k2 items?

1 Answer 1


You can do this by creating a hidden field in RS Form and in its default value field insert a code as below:

$jinput = JFactory::getApplication()->input;
return ($jinput->get('id', 'No K2 Item', 'INT'));

Your hidden field will be sending the K2 Item's id, assuming you are only using it inside K2 items, with each submission.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.