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());
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题