Created
February 23, 2019 13:07
-
-
Save alasvant/3ae6dba506a466d33ace41c3216c5658 to your computer and use it in GitHub Desktop.
Sample view to render the TagManagerElementBlock.cs values for editors in edit mode and hidden input fields in the form.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using EPiServer.Forms.EditView | |
@using EPiServer.Editor | |
@model AlloyWithFind.Models.FormElements.TagManagerElementBlock | |
@* if in edit mode render the GTM values so that the editor can see them *@ | |
@if (PageEditing.PageIsInEditMode) | |
{ | |
<span class="Form__Element FormHidden @Html.Raw(ConstantsFormsUI.CSS_InvisibleElement)">@Model.EditViewFriendlyTitle</span> | |
} | |
else | |
{ | |
<input name="gtmFormName" id="@(Model.FormElement.Guid)_name" type="hidden" value="@Model.FormName" class="Form__Element FormHidden FormHideInSummarized" @Html.Raw(Model.AttributesString) data-f-type="hidden" /> | |
<input name="gtmCategoryName" id="@(Model.FormElement.Guid)_category" type="hidden" value="@Model.CategoryName" class="Form__Element FormHidden FormHideInSummarized" @Html.Raw(Model.AttributesString) data-f-type="hidden" /> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment