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 ...
随机推荐
- java中 正则表达式的使用
推荐使用第一种 第一种: //对接收的文件名的合法性进行验证 String fileName="127.0.0.1_01_20140428165022174.jpg"; Strin ...
- ArrayList源代码深入剖析
第1部分 ArrayList介绍ArrayList底层采用数组实现,它的容量能动态增长.它继承于AbstractList,实现了List, RandomAccess, Cloneable, java. ...
- 基于redis实现的分布式锁
基于redis实现的分布式锁 我们知道,在多线程环境中,锁是实现共享资源互斥访问的重要机制,以保证任何时刻只有一个线程在访问共享资源.锁的基本原理是:用一个状态值表示锁,对锁的占用和释放通过状态值来标 ...
- R语言学习笔记:矩阵与数组(array)
元素可以保存在多个维度的对象中,数组存储的是多维数据元素,矩阵的是数组的特殊情况,它具有两维. 创建数组的几种方法. 1. > m<-c(45,23,66,77,33,44,56,12,7 ...
- IPC是什么意思?
IPC(Inter-Process Communication,进程间通信)IPC ( Instruction per Clock 及CPU每一时钟周期内所执行的指令多少) IPC代表了一款处理器的设 ...
- 【HDOJ】3727 Jewel
静态区间第K大值.主席树和划分树都可解. /* 3727 */ #include <iostream> #include <sstream> #include <stri ...
- 【HDOJ】4122 Alice's mooncake shop
RMQ的基础题目,简单题. /* 4122 */ #include <iostream> #include <sstream> #include <string> ...
- git整理纷乱的历史合并记录
https://github.com/Epix37/Hearthstone-Deck-Tracker 以上面版本库的master分支为例 父节点1 SHA-1: a21142968282ae49720 ...
- mysqld -install命令时出现install/remove of the service denied错误的原因和解决办法
原因:没有使用管理员权限 解决方法:使用管理员权限打开cmd,然后运行mysqld -install,服务安装成功
- 【转】The final local variable xxx cannot be assigned, since it is defined in an enclosing type
文地址:http://blog.163.com/benben_long/blog/static/199458243201481102257544/ 本文就自己编程时候遇到的一个问题,简要描述一下,并提 ...