Umbraco Forms 使Rendering Forms scripts 在不同的template中
具体请参考 https://our.umbraco.org/documentation/products/umbracoforms/developer/Rendering-Scripts/
转载 https://our.umbraco.org/documentation/products/umbracoforms/developer/Rendering-Scripts/
Rendering Forms scripts where you want
Besides markup Forms will also output some JavaScript, by default this JavaScript is outputted just below the markup. If you wish to change this behaviour follow the next steps (like if all your js is rendered at the bottom of you page)
Change the Forms partial view macro
First we'll need to tell the Forms partial macro (that is used to render forms) to only render the markup and not the scripts. Navigate to the developer section and open the > Partial View Macro File > Insert Umbraco Form
It should have the following contents
@inherits Umbraco.Web.Macros.PartialViewMacroPage @if (Model.MacroParameters["FormGuid"] != null)
{
var s = Model.MacroParameters["FormGuid"].ToString();
var g = new Guid(s); Html.RenderAction("Render", "UmbracoForms", new {formId = g});
Here we'll make a small change, in the RenderAction call we'll provide an additional argument mode = "form"
so go from
Html.RenderAction("Render", "UmbracoForms", new {formId = g});
to
Html.RenderAction("Render", "UmbracoForms", new {formId = g, mode = "form"});
Place the Render scripts macro on your template
Now we'll need to let Forms know where we want to output the script instead. So Navigate to the settings section and select your template that should contain the scripts. There simply insert the Render Umbraco Forms Scripts macro.
比如,我们想把Forms 的scripts包含在master template中,那么就在master template 中的尾部 Insert Macro - Render forms scripts
系统会自动产生 语句 @Umbraco.RenderMacro("FormsRenderScripts") 放在master template的尾部
Umbraco Forms 使Rendering Forms scripts 在不同的template中的更多相关文章
- Linux Vi进入编辑模式后使用方向键的时候,并不会使光标移动,而是在命令行中出现A、B、C、D四个字母
在linux下,初始使用Vi的时候有两个典型的问题: 1.在编辑模式下使用方向键的时候,并不会使光标移动,而是在命令行中出现A.B.C.D四个字母: 2.当编辑出现错误,想要删除时,发现Backspa ...
- C#Windows Forms 使MessageBox顶层显示--xdd
方法1. MessageBox.Show("Text", "Caption", MessageBoxButtons.OK, MessageBoxIcon.Inf ...
- POJ 3294 Life Forms 后缀数组+二分 求至少k个字符串中包含的最长子串
Life Forms Description You may have wondered why most extraterrestrial life forms resemble humans, ...
- forms.ModelForm 与 forms.Form
1. 首先 两者都是forms里的常用类. 2. 这两个类在应用上是有区别的.一般情况下,如果要将表单中的数据写入数据库或者修改某些记录的值,就要让表单类继承ModelForm; 如果提交表单后 不会 ...
- POJ-3294-Life Forms(后缀数组-不小于 k 个字符串中的最长子串)
题意: 给定 n 个字符串,求出现在不小于 k 个字符串中的最长子串. 分析: 将 n 个字符串连起来,中间用不相同的且没有出现在字符串中的字符隔开,求后缀数组. 然后二分答案,将后缀分成若干组,判断 ...
- Life Forms POJ - 3294(不小于k个字符串中的最长子串)
题意: 求不小于字符串一半长度个字符串中的最长字串 解析: 论文题例11 将n个字符串连起来,中间用不相同的且没有出现在字符串中的字符隔开, 求后缀数组, 然后二分答案变为判定性问题, 然后判断每组的 ...
- js 使某个页面不允许在子iframe中打开的解决办法
在页面中添加如下js代码<script> if (window.parent !== window.self) { window.parent.location.reload(); }&l ...
- 呃,如何使 .NET 程序,在 64位 系统 中,以 32位 模式运行。
其实最简单的方法就是在解决方案中,把平台设为 x86 就好了哈~ 但是今天遇到一个第三方的软件,它调用的一个 dll 是 32位 的,可能它没有测试过在 64位 系统下运行的情况,它在编译时是按默 ...
- mybatis generator如何定制JavaTypeResolver,使smallint类型的数据库字段在po中的类型为Integer?
一.问题概述 忙了一段时间的jenkins持续集成,又要开始开发任务了.这两天在用mybatis generator来逆向生成dao层工程. 其中一个问题在于,组长在设计表的时候,不少枚举使用了sma ...
随机推荐
- codeforces #309 div1 D
求最小值最大显然是要二分 二分之后转换成了判定性问题 我们考虑哪些点一定不能选 显然是将所有可选点选中之后依然不满足条件的点不能选 那么我们不妨维护一个堆,每次取出堆顶看看是否满足条件 不满足条件就p ...
- C/C++语言参数传递----函数/方法 参数的指针引用传递
int m_value = 1; void func(int *p) { p = &m_value; } int main(int argc, char *argv[]) { int n = ...
- ANDROID_MARS学习笔记_S01_003layout初步
一.layout介绍 二.测试linear_layout1.activity_main.xml <?xml version="1.0" encoding="utf- ...
- [原]捉虫记3:_ConectionPtr指针调用open失败
背景 产品使用MySQL来存储报警服务产生的报警.在报警服务的组件中使用ADO接口 客户方有两台计算机,一台计算机A用来组态,且可以对设备进行调试,操作系统是Win7 64bit 专业版,安装了VS2 ...
- android系统平台显示驱动开发简要:Samsung LCD接口篇『三』
平台信息: 内核:linux3.4.39系统:android4.4 平台:S5P4418(cortex a9) 作者:瘋耔(欢迎转载,请注明作者) 欢迎指正错误,共同学习.共同进步!! 关注博主新浪博 ...
- Eclipse修改编码后乱码解决
Eclipse用了一段时间,都是用的gbk编码的,突然想要规范下,强迫症犯了,于是将在Window->Preference->Appearances->Workspace修改Text ...
- 【JAVA】别特注意,POI中getLastRowNum() 和getLastCellNum()的区别
hssfSheet.getLastRowNum();.行标,比行数小1 hssfSheet.getRow(k).getLastCellNum();//获取列数,比最后一列列标大1 行标.列标都以0开始 ...
- HDU 3549 Flow Problem 流问题(最大流,入门)
题意:给个赤裸的最大流问题. 思路:EK+BFS解决.跟HDU1532几乎一样的. #include <bits/stdc++.h> #define LL long long #defin ...
- OS.ENVIRON()详解
OS.ENVIRON()详解
- Crosstool-ng制作交叉编译工具链
Crosstool-ng制作交叉编译工具链 交叉编译器可以用现成的,比如CodeSourcery制作的交叉编译器,也可以自己制作,一般是用kernel+gcc+glibc+binutils的源码包来编 ...