dongxian5735 2018-05-18 12:14
浏览 27
已采纳

特定页面的表格提交(Concrete5 8.3.2)

CMS: Concrete5 Version: 8.3.2

I added a Express Form Block in a Global Area. If someone fills out the form, I get a e-mail response. In the E-mail response it is not clear from what specific page the form is send. It only show the name of the form (same on all pages because of Global Area), the form results and link to result in the CMS.

So I need to insert something like $page->getCollectionName() in express_form > controller.php

I found a link (https://www.concrete5.org/community/forums/customizing_c5/form-submission-from-specific-page/#905411) but this is for an older version and does not seem work in the latest version.

Any Ideas?

EDIT SOLUTION:

Edited:block_express_form_submission.php

<?php

defined('C5_EXECUTE') or die("Access Denied.");

$formDisplayUrl = URL::to('/dashboard/reports/forms', 'view', $entity->getEntityResultsNodeId());
$c = Page::getCurrentPage();

$submittedData = '';
foreach($attributes as $value) {
    $submittedData .= $value->getAttributeKey()->getAttributeKeyDisplayName('text') . ":
";
    $submittedData .= $value->getPlainTextValue() . "

";
}

$body = t("
Form pagename: %s
Form name: %s 

%s

View all form results %s 

", $c->getCollectionName(), $formName, $submittedData, $formDisplayUrl);
  • 写回答

1条回答 默认 最新

  • douhuxi4145 2018-05-22 07:08
    关注

    concrete5 uses the /concrete/mail/block_form_submission.php email template to send notifications about Express Form submissions.

    You can customize this template by copying this file to the /application/mail folder and editing it.

    For instance, to add the page name, you could add these lines:

    $c = Page::getCurrentPage();
    $body .= "
    " . t('Page name: %s', $c->getCollectionName());
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 为什么我写出来的绘图程序是这样的,有没有lao哥改一下
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥15 绘制多分类任务的roc曲线时只画出了一类的roc,其它的auc显示为nan
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败