I have a module that appears on an article page. The module has a form and I would like to send the article's title and page URL as part of the information sent through the form. Using $this->item->title doesn't seem to work.

  • Welcome to JSE. Please take our tour and read How to Ask. Please show us your code that "doesn't work" and please be more descriptive about how it "doesn't work". Are any errors being generated? White screen of death? Simply no value is presented where expected? Feb 15, 2021 at 23:15
  • Would 2 lines of jQuery be sufficient for this task? or is server side needed for some reason? Feb 16, 2021 at 0:19

2 Answers 2


You can use Factory->getDocument title and link.

use Joomla\CMS\Factory;

$doc = Factory::getDocument();
$title = $doc->getTitle();
$url = $doc->getLink();
  • Thank you for contributing Fabiano. Please take our tour. If this answer is a little short on specifics for the OP to implement, please be prepared to further explain your recommended solution. Nov 15, 2021 at 22:22

In order to carry a variable from page to page php gives us the ability with session. check here: https://www.joomlashack.com/blog/how-tos/development/how-to-use-sessions-in-joomla/

  • It is absolutely vital that insights be statically written in the answer. If the website dies or the page is moved, then the link becomes a deadend and the answer is rendered useless. It is okay to supply a link to the source that you are referencing, but please copy and quote-format the specific portion of valuable advice here. If there is too much to sensibly copy into an answer and you'd rather just drop a hyperlink on the page, then the correct action would be to put the link in a comment under the question (once you have the privilege to do so). Feb 16, 2021 at 23:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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