Article / page title in emailsubject and/or form field

zassie 02 Mar, 2012
Hello there.
I've been working on a new form and i've run into a problem I don't seem te find an answer to.

Running latest Joomla and Chonoform versions. Catalog system in Yootheme's Zoo.
Sample of form: http://www.goochelclown.nl/vrienden-van-kriek/meet-greet/item/sjaak-de-piraat-s-piraten-avontuur?category_id=20#optieformulier

Because the form is loaded into a module and will be shows on 100+ pages I would like to get the article / pagetitle to appear on the designated spot (as can be seen on the URL) and/or in the email subject. So I know where the email is for.

I'm not a coder (basic HTML is as far as I get). Is this possible in a (relatively) simple way?

Secondly due to the tabbed structure of the page the "Thank You" message is lost, not a big issue since they receive an email after submitting, but if there is a known "quick fix" for this I'd be happy to apply it.

Thanks for your time.
zassie 02 Mar, 2012
Seems like what I wnat is almost impossble with zoo... if you're not familiar with coding.

I do want something, even the URL where the form was send from will do, anything to give a hint what the customer is responding to.

Any ideas? code snippets... or....
zassie 03 Mar, 2012
Will something like this work?

<?php return JFactory::getDocument()->getTitle(); ?>

If only I can get something in a hidden field It will be more then enough.

Any thoughts? anyone?
GreyHead 03 Mar, 2012
Hi zassie,

Sorry, I don't know anything much about Zoo except that the tables are complicated so it's difficult to read or write data reliably.

Please try this. Add a Hidden element to your form preview box and give it the name title.

Add a Custom Code action to the On Load event, drag it up before the Show HTML action and put this code in the code box:
<?php
$doc =& JFactory::getDocument();
$form->data['title'] = $doc->getTitle();
?>

The problem may be that this gets the page title and not the article title - if the two are the same it should work OK.

Bob
zassie 03 Mar, 2012
Bob,

Thank you for your response!

That would be a great solution. When I have the page open I read the article title from the browser head, so I guess they would be the same.

I've followed your steps: created the idden field, named it title, placed the code snippet in a custom code field and placed that above the HTML bit in onLoad but I only get {title} back in the email.

Any thoughts?
zassie 03 Mar, 2012
Dear Bob,

Please ignore my previuos post.. I misspelled title... in the form field.
You're solution works fine!

Thanks a lot!!!!
This topic is locked and no more replies can be posted.