Skip to content

Commit 58d726a

Browse files
committed
Add rendering view
1 parent 10b1d35 commit 58d726a

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
@using Umbraco.Cms.Integrations.Crm.Dynamics.Models.ViewModels;
2+
@using Umbraco.Cms.Integrations.Crm.Dynamics.Models;
3+
4+
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<FormViewModel>
5+
6+
@{
7+
var id = Guid.NewGuid();
8+
}
9+
10+
@if (Model != null)
11+
{
12+
@if (Model.Module.HasFlag(DynamicsModule.Outbound))
13+
{
14+
@if (Model.IframeEmbedded)
15+
{
16+
<iframe frameBorder="0" style="width:100%;height:100%;" id=@id></iframe>
17+
<script>
18+
var sandboxSrc = "https://@(Model.Hostname)/t/formsandbox/@(Model.WebsiteId)/@(Model.FormBlockId)?ad="
19+
+ encodeURIComponent(document.location.toString()); document.getElementById('@id').setAttribute('src', sandboxSrc);
20+
</script>
21+
}
22+
else
23+
{
24+
<div data-form-block-id="@Model.FormBlockId"></div>
25+
<script src="https://mktdplp102cdn.azureedge.net/public/latest/js/form-loader.js?v=1.84.2007"></script>
26+
<div id="@Model.ContainerId"></div>
27+
<script src="https://mktdplp102cdn.azureedge.net/public/latest/js/ws-tracking.js?v=1.84.2007"></script>
28+
<div class="@Model.ContainerClass" style="display:none"
29+
data-website-id="@Model.WebsiteId" data-hostname="@Model.Hostname"></div>
30+
}
31+
}
32+
else
33+
{
34+
@if (Model.IframeEmbedded)
35+
{
36+
<iframe frameBorder="0" style="width:100%;height:100%;" id=@id src="@Model.StandaloneUrl"></iframe>
37+
}
38+
else
39+
{
40+
@Html.Raw(Model.Html)
41+
}
42+
}
43+
}

0 commit comments

Comments
 (0)