Buy Now
Sign in

Auto attach meta-tags or page-name to a form-mail

stoffhausen , December 03 2014, 14:50
S
stoffhausen 6
December 03 2014, 14:50 #339999
hi there!
My client asked me, if it's possible to create one simple form which is displayed on different pages (I know this is not the problem ). But: Is there a way to auto-attach the actual page-title, so my customer knows on which page the visitor filled out the form?

this would be so great! thank you for your tips!
greetings from austria
chris!
GreyHead 64
December 03 2014, 15:07 #340002
Hi Chris,

Please see this FAQ

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
S
scagnoz 7
December 23 2014, 19:14 #340761
Hi Bob,
can you explain why inserting the code
<?php
$doc =& JFactory::getDocument();
?>
<input type='hidden' name='page_title' id='page_title' value='<?php echo $doc->getTitle(); ?>' />

on a pure code custom field gives me back this error?

Fatal error: Call to undefined method JDocumentHTML::_() in /membri/wta/administrator/components/com_chronoforms5/chronoforms/actions/html/html.php on line 307

Unpublishing the form solves the problem
Thank you in advance!
GreyHead 64
December 24 2014, 11:46 #340777
Hi scagnoz,

Hmmm . . . it looks as though Max has use $doc for an internal ChronoForms variable in that file - it maybe that the two are getting mixed up. Please try this version instead, it just uses $jdoc instead of $doc.
<?php
$jdoc = JFactory::getDocument();
?>
<input type='hidden' name='page_title' id='page_title' value='<?php echo $jdoc->getTitle(); ?>' />

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much