Breadcrumb or page name as form subject
Permalink
I have a form block in most pages and when people submit the form, my client wants either page title or breadcrumb to be the subject, so that he knows from which page the user is contacting him.
I have breadcrumb block in scrapbook called "bread".
I tried the following on form block/form/controller.php
//page title
$subject = $c->getCollectionName();
$mh->setSubject(t($subject, $this->surveyName));
//Breadcrumb
$subject = Block::getByName('bread');
$mh->setSubject(t($subject, $this->surveyName));
But no success. Can someone please help me.
I have breadcrumb block in scrapbook called "bread".
I tried the following on form block/form/controller.php
//page title
$subject = $c->getCollectionName();
$mh->setSubject(t($subject, $this->surveyName));
//Breadcrumb
$subject = Block::getByName('bread');
$mh->setSubject(t($subject, $this->surveyName));
But no success. Can someone please help me.
or
For the second one, there's no way that will work. The object you get back is not string, so there is no way to use it to set the subject.