Hello,
I have a basic form on my site http://investinginmiami.com/ at the bottom of each page. When a user sends me an email through the form I would like to have it include the title of the page they were on. I searched through the forum and found 2 similar entries, but didn't have any luck getting them to work.
I am using the wizard to create my forms with a validated copy of chronoforms version 4.0 on a Joomla 3.1.1 website.
I have a basic form on my site http://investinginmiami.com/ at the bottom of each page. When a user sends me an email through the form I would like to have it include the title of the page they were on. I searched through the forum and found 2 similar entries, but didn't have any luck getting them to work.
I am using the wizard to create my forms with a validated copy of chronoforms version 4.0 on a Joomla 3.1.1 website.
Hi Bob,
Thanks for your suggestion, it worked, and then some :wink: In the email, I am receiving the title of the page but immediately after the title is some code...kind of like the following... where TITLE is the title of my page:
TITLEgetTitle(); ?>' />
Thanks for your suggestion, it worked, and then some :wink: In the email, I am receiving the title of the page but immediately after the title is some code...kind of like the following... where TITLE is the title of my page:
TITLEgetTitle(); ?>' />
Hi nicksab,
Looks like there may be a typo with a quote or space - exactly what code have you used?
Bob
Looks like there may be a typo with a quote or space - exactly what code have you used?
Bob
Here's what I have plugged in:
<?php
$doc =& JFactory::getDocument();
?>
<input type='hidden' name='page_title' id='page_title' value='<?php echo $doc->getTitle(); ?>' />
<?php
$doc =& JFactory::getDocument();
?>
<input type='hidden' name='page_title' id='page_title' value='<?php echo $doc->getTitle(); ?>' />
Hi nicksab,
Stefano (in another thread) is also having problems with this. Please try entering it into a Custom Element element (from the Advanced elements group) in the Preview box.
Bob
Stefano (in another thread) is also having problems with this. Please try entering it into a Custom Element element (from the Advanced elements group) in the Preview box.
Bob
I already had it plugged into the "Code" section of a "Custom Element" in the "Preview" tab of the "Form Wizard"

Hi nicksab,
I tested this again and it works OK:
Giving this in the page source:
The only difference I spot is that I have the Pure Code box ticked.
Bob
I tested this again and it works OK:
<?php
$doc =& JFactory::getDocument();
?>
<input type='hidden' name='page_title' id='page_title' value='<?php echo $doc->getTitle(); ?>' />
<input type='hidden' name='page_base' id='page_base' value='<?php echo $doc->getBase(); ?>' />
Giving this in the page source:
<input id="page_title" type="hidden" value="Home" name="page_title">
<input id="page_base" type="hidden" value="http://example.com/index.php/2-uncategorised/2-test-get-doc-info" name="page_base">
The only difference I spot is that I have the Pure Code box ticked.
Bob
This topic is locked and no more replies can be posted.