Interface ITweakButton
Experimental new API in v15.07 to improve how to configure the Ui of a button.
Tip
Read more about this in Toolbar Builder Guide – Tweak API for Buttons new 15.07
Namespace: ToSic.Sxc.Edit.Toolbar
Assembly: ToSic.Sxc.dll
Syntax
[PublicApi]
public interface ITweakButton
Remarks
Added in v15.07
Methods
| Improve this Doc View SourceClasses(string)
Set one or more classes on the button.
Declaration
ITweakButton Classes(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | a string containing one or more CSS class names |
Returns
Type | Description |
---|---|
ITweakButton |
Color(string, string, string, string)
Set the color of this button.
A color can be red
, green
or #FFCC66
as well as transparent colors such as #FFCC6699
Declaration
ITweakButton Color(string color = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", string background = null, string foreground = null)
Parameters
Type | Name | Description |
---|---|---|
string | color | The main color parameter. Can contain two values, comma separated. |
string | noParamOrder | |
string | background | Background color - will only take affect if the |
string | foreground | Foreground color - will only take affect if the |
Returns
Type | Description |
---|---|
ITweakButton |
Filter(object)
Add filter information to the button - usually when opening Data dialogs.
Declaration
ITweakButton Filter(object value)
Parameters
Type | Name | Description |
---|---|---|
object | value | A string such as |
Returns
Type | Description |
---|---|
ITweakButton |
Filter(string, object)
Add filter information to the button - usually when opening Data dialogs.
Declaration
ITweakButton Filter(string name, object value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name/key which comes before the |
object | value | The value which comes after the |
Returns
Type | Description |
---|---|
ITweakButton |
FormParameters(object)
Add form-parameters to the button - which are available in the data.parameters
in formulas.
Declaration
ITweakButton FormParameters(object value)
Parameters
Type | Name | Description |
---|---|---|
object | value | A string such as |
Returns
Type | Description |
---|---|
ITweakButton |
Remarks
Added in 16.02
FormParameters(string, object)
Add form-parameters to the button - which are available in the data.parameters
in formulas.
Declaration
ITweakButton FormParameters(string name, object value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name/key which comes before the |
object | value | The value which comes after the |
Returns
Type | Description |
---|---|
ITweakButton |
Remarks
Added in 16.02
Group(string)
Set what group the button is in. This is rarely used.
Declaration
ITweakButton Group(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | the group name |
Returns
Type | Description |
---|---|
ITweakButton |
Icon(string)
Set the icon for this button.
Declaration
ITweakButton Icon(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | One of a few predefined names, or a SVG string. |
Returns
Type | Description |
---|---|
ITweakButton |
Note(string, string, string, string)
Add a floating note to the button.
Declaration
ITweakButton Note(string note = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", string type = null, string background = null)
Parameters
Type | Name | Description |
---|---|---|
string | note | The note/message |
string | noParamOrder | |
string | type | Optional type, like |
string | background | Background color. |
Returns
Type | Description |
---|---|
ITweakButton |
Remarks
- New feature in v15.07
Parameters(object)
Add parameters to the button - which are usually used when executing the command.
Tip
These parameters are used in the page itself and not forwarded to the form. Use FormParameters(object) for that purpose.
Declaration
ITweakButton Parameters(object value)
Parameters
Type | Name | Description |
---|---|---|
object | value | A string such as |
Returns
Type | Description |
---|---|
ITweakButton |
Parameters(string, object)
Declaration
ITweakButton Parameters(string name, object value)
Parameters
Type | Name | Description |
---|---|---|
string | name | |
object | value |
Returns
Type | Description |
---|---|
ITweakButton |
Position(int)
Specify the position of the button.
0
means in the very front, 1
is right after the first button, etc.
-1
means the last button, -2
is the second last, etc.
Declaration
ITweakButton Position(int value)
Parameters
Type | Name | Description |
---|---|---|
int | value |
Returns
Type | Description |
---|---|
ITweakButton |
Prefill(object)
Add prefill information to the button, usually for creating new Entities.
Declaration
ITweakButton Prefill(object value)
Parameters
Type | Name | Description |
---|---|---|
object | value | A string such as |
Returns
Type | Description |
---|---|
ITweakButton |
Prefill(string, object)
Add prefill information to the button, usually for creating new Entities.
Declaration
ITweakButton Prefill(string name, object value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name/key which comes before the |
object | value | The value which comes after the |
Returns
Type | Description |
---|---|
ITweakButton |
Show(bool)
Set the show of this button.
Declaration
ITweakButton Show(bool show = true)
Parameters
Type | Name | Description |
---|---|---|
bool | show | Optional show value, default is |
Returns
Type | Description |
---|---|
ITweakButton |
Tooltip(string)
Set the title / Tooltip of the button.
Declaration
ITweakButton Tooltip(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | The title/tooltip to show |
Returns
Type | Description |
---|---|
ITweakButton |
Ui(object)
Add a general ui-rule for things which are not in the standard API.
Declaration
ITweakButton Ui(object value)
Parameters
Type | Name | Description |
---|---|---|
object | value | a string such as |
Returns
Type | Description |
---|---|
ITweakButton |
Ui(string, object)
Add a general UI rule for things which are not in the standard API.
Declaration
ITweakButton Ui(string name, object value)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name/key which comes before the |
object | value | The value which comes after the |
Returns
Type | Description |
---|---|
ITweakButton |