• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Form popup / K2 Article / Get K2 Title

Form popup / K2 Article / Get K2 Title 10 years 4 months ago #29629

  • wdct_4
  • wdct_4's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
  • Thank you received: 1
Hi there, I'm using this in order to get title of my K2 article in to my form:
//<code>
$db = JFactory::getDBO();
$articleid = JRequest::getInt('id');
$db->setQuery('SELECT title FROM #__k2_items WHERE id='.$articleid);
$myid=$db->loadResult();
return "Please send me info for product: ".$db->loadResult();
//</code>

If the form added to my K2 article everything works!
I'm tryinig to show the form with a popup button using this code:
<div><a href="index.php?option=com_rsform&amp;formId=3&amp;tmpl=component" target="_blank" type="iframe" class="jcepopup noicon" data-mediabox="width[600]">Contcat us!</a></div>

Contact form is showing in my popup but I'm losing the item title in my default value.
I can understand that the form is called directly from RSFORM component and "$articleid" cannot be found so it returns Null.

Is there any way to get the article ID inside my popup href string?
Or some other way to get item title inside my popup window?

Thank you in advance!
The administrator has disabled public write access.
The following user(s) said Thank You: hoangtuan906

Form popup / K2 Article / Get K2 Title 8 years 4 months ago #36173

very useful with this code , working well.

Hi there, I'm using this in order to get title of my K2 article in to my form:
//<code>
$db = JFactory::getDBO();
$articleid = JRequest::getInt('id');
$db->setQuery('SELECT title FROM #__k2_items WHERE id='.$articleid);
$myid=$db->loadResult();
return "Please send me info for product: ".$db->loadResult();
//</code>
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!