Skip to content

Commit efe690f

Browse files
committed
minor
1 parent 8e287d2 commit efe690f

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

formulas/_120 Using Parameters.cshtml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
Use emphemeral fields
2424
</li>
2525
<li>
26-
Use data.parameters in your formulas
26+
Use <code>data.parameters</code> in your formulas <em>new in v14</em>
2727
</li>
2828
</ul>
2929
<br>
@@ -49,20 +49,23 @@
4949
<p>Learn more about Ephemeral fields <a href="https://docs.2sxc.org/basics/data/fields/ephemeral.html">here</a>.</p>
5050

5151

52-
<h3>Ephemeral field <snippet id="formulas-ephemeral">
52+
<h3>Ephemeral field
53+
<snippet id="formulas-ephemeral">
5354
@Edit.Toolbar(toolbar: new[] { "toolbar=empty", "+new&icon=" + tbHlp.Icon() + "?contentType=FormulasEphemeral"})
55+
@Edit.Toolbar(toolbar: new[] { "toolbar=empty", "+new&icon=" + tbHlp.Icon() + "?contentType=FormulasEphemeral&prefill:VarShowAdvanced=true"})
5456
</snippet>
5557
</h3>
5658
<p>
57-
VarShowAdvanced is an ephemeral field and thus not saved in the database. This formula determines the visibility of
58-
the Advanced Settings group. The group becomes visible, when the VarShowAdvanced toggle is active.
59+
<code>VarShowAdvanced</code> is an ephemeral field and thus not saved in the database.
60+
This formula determines the visibility of the Advanced Settings group.
61+
The group becomes visible, when the VarShowAdvanced toggle is active.
5962
<br>
60-
<em>Click on the (+) button above to see the edit-UI with the formula. </em>
63+
<em>Click on the (Σ) button above to see the edit-UI with the formula. </em>
6164
</p>
6265

6366
<code id="formulas-ephemeral-label"></code>
6467
<hide-silent> @* Show only this snippet *@
65-
@Html.Partial("../shared/_source-code.cshtml", new { Path, Snippet = "formulas-ephemeral", Size = 40 })
68+
@Html.Partial("../shared/_source-code.cshtml", new { Path, Snippet = "formulas-ephemeral", Size = 80 })
6669

6770
@Html.Partial("_PartFormulas.cshtml", new {
6871
ContentType = "FormulasEphemeral",
@@ -78,27 +81,24 @@
7881

7982
<h3>Configuration with parameters</h3>
8083
<span>
81-
<code>prefill:showAdvanced=true</code>:
82-
<snippet id="formulas-showAdvanced-true">
83-
@Edit.Toolbar(toolbar: new[] { "toolbar=empty", "+new&icon=" + tbHlp.Icon() + "?contentType=FormulasParameters&prefill:showAdvanced=true"})
84-
</snippet>
84+
<snippet id="formulas-showAdvanced">
85+
<code>prefill:showAdvanced=true</code>:
86+
@Kit.Toolbar.Empty().New("FormulasParameters", ui: "icon=" + tbHlp.Icon(), prefill: "showAdvanced=true").AsTag()
8587
<br>
86-
<code>prefill:showAdvanced=false</code>:
87-
<snippet id="formulas-showAdvanced-false">
88-
@Edit.Toolbar(toolbar: new[] { "toolbar=empty", "+new&icon=" + tbHlp.Icon() + "?contentType=FormulasParameters&prefill:showAdvanced=false"})
89-
</snippet>
88+
<code>prefill:showAdvanced=false</code>:
89+
@Kit.Toolbar.Empty().New("FormulasParameters", ui: "icon=" + tbHlp.Icon(), prefill: "showAdvanced=false").AsTag()
90+
</snippet>
9091
</span>
9192
<p>
92-
VarShowAdvanced is a parameter, thas was passed with the toolbar prefill. This formula determines the visibility of
93-
the Advanced Settings group. The group becomes visible, when the passed VarShowAdvanced parameter is true.
93+
<code>showAdvanced</code> is a parameter, thas was passed with the toolbar prefill. This formula determines the visibility of
94+
the Advanced Settings group. The group becomes visible, when the passed <code>showAdvanced</code> parameter is true.
9495
<br>
95-
<em>Click on the (+) button above to see the edit-UI with the formula based on the passed prefill parameter. </em>
96+
<em>Click on the (Σ) button above to see the edit-UI with the formula based on the passed prefill parameter. </em>
9697
</p>
9798

9899
<code id="formulas-showAdvanced-label"></code>
99100
<hide-silent> @* Show only this snippet *@
100-
@Html.Partial("../shared/_source-code.cshtml", new { Path, Snippet = "formulas-showAdvanced-true", Size = 40 })
101-
@Html.Partial("../shared/_source-code.cshtml", new { Path, Snippet = "formulas-showAdvanced-false", Size = 40 })
101+
@Html.Partial("../shared/_source-code.cshtml", new { Path, Snippet = "formulas-showAdvanced", Size = 120 })
102102

103103
@Html.Partial("_PartFormulas.cshtml", new {
104104
ContentType = "FormulasParameters",

shared/Helpers.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public dynamic LiExtLink(string target, string description) {
122122
public string GetFullPath(string filePath) {
123123
#if NETCOREAPP
124124
// This is the Oqtane implementation - cannot use Server.MapPath
125+
// 2sxclint:disable:v14-no-getservice
125126
var hostingEnv = GetService<Microsoft.AspNetCore.Hosting.IHostingEnvironment>();
126127
var pathWithTrimmedFirstSlash = filePath.TrimStart(new [] { '/', '\\' });
127128
return System.IO.Path.Combine(hostingEnv.ContentRootPath, pathWithTrimmedFirstSlash);

shared/_KitBaseClassInfoBox.cshtml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
@inherits Custom.Hybrid.Razor14
2-
2+
@*
3+
Info: documentation purpose only
4+
2sxclint:disable:v14-no-getservice
5+
*@
36
@{
47
var ServiceName = DynamicModel.ServiceName;
58
var Service = DynamicModel.Service;

0 commit comments

Comments
 (0)