Forums

Question about retrieving the page title in Chronoforms 8

Joomron 08 Mar, 2025

Hello,

I have been happily using Chronoforms for years, but I’ve now run into an issue.

In Chronoforms 7, I could easily use the {document:title} shortcode to retrieve the title of a page. Is this option also available in version 8? I haven’t been able to find it.

I discovered that with Read Data, I can fetch the title from the content table, but this retrieves all titles, whereas I only need the title of the page where the form is being displayed via a module. This title is the car type, which is automatically filled in for the applicant.

How can I solve this in Chronoforms 8? In version 7, this was much easier using {document:title}.

I look forward to your response.

Thanks in advance!

Best regards, Ron

Max_admin 08 Mar, 2025
Answer
1 Likes

Hi Ron

You can use this code in a PHP action:

$document = Joomla\CMS\Factory::getDocument();
return $document->getTitle();

then you can use the action variable:

{var:php_action_name}

I will also add this to the next v8 update shortcodes so that you can still use {document:title}

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Joomron 08 Mar, 2025

Hi Max,

Thanks for your response!

Could you explain to me step by step how this works? Or is there perhaps a (video) guide available? I’ve never done this before.

I’d like the text field to automatically display the title (the car brand), as my website features more than 200 cars.

Looking forward to your reply. Thanks in advance!

Best regards, Ron ๐Ÿ˜ƒ๐Ÿ‘

Joomron 08 Mar, 2025

I found it, and it works great! ๐Ÿ˜ƒ๐Ÿ‘

Max_admin 08 Mar, 2025

No problem ๐Ÿ˜Š, it should look like this:

then use {var:php7} but the next update should have the {document:title}

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
You need to login to be able to post a reply.