• 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: How to tell which article the form was called from

How to tell which article the form was called from 11 years 5 months ago #25589

Hi, i am using the rs form and it is actually the simplest Joomla! form i have come across.. i just have one question. i have one form and i have assigned it to one page called "Booking" and i would like to call it from every page using a button. this works well but i would like to add a functionality that tells which page the form was called from. I am thinking of creating a field and then auto filling it with the page title the form was called from. Anyone knows how i can achieve this?
The administrator has disabled public write access.

How to tell which article the form was called from 11 years 5 months ago #25594

  • djseleco
  • djseleco's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 47
  • Thank you received: 10
The administrator has disabled public write access.

How to tell which article the form was called from 11 years 5 months ago #25597

thanks djseleco i have tried the code but it gives me the url of the current page. that is the booking page. i would like to have the url of the page that called the booking form page. could you assist with that?
The administrator has disabled public write access.

How to tell which article the form was called from 11 years 5 months ago #25639

Hello,

I am also looking for solution to display the article title in dafault value of a field.

As in Joomla 1.5 the code below was working great, in Joomla 2.5 it displays category name, buto not a title of the article where the form is placed. :dry:
//<code>
$doc = JFactory::getDocument();
return $doc->getTitle();
//</code>
The administrator has disabled public write access.

How to tell which article the form was called from 11 years 5 months ago #25727

anyone with a solution to this?
The administrator has disabled public write access.

How to tell which article the form was called from 11 years 5 months ago #25833

//<code>
$option = JRequest::getCmd('option');
$view = JRequest::getCmd('view');
if ($option=="com_content" && $view=="article") {
    $ids = explode(':',JRequest::getString('id'));
    $article_id = $ids[0];
    $article =& JTable::getInstance("content");
    $article->load($article_id);
    return $article->get("title");
}
//</code>

You can enter this in the default value of a field. It works well with Hidden fields too.

NOT: I only tested with Article plugin, may not work with Module.
Last Edit: 11 years 5 months ago by ancogenli.
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!