Interface IToolbarBuilder
The toolbar builder helps you create Toolbar configurations for the UI. Note that it has a fluid API, and each method/use returns a fresh object with the updated configuration.
Inherited Members
Namespace: ToSic.Sxc.Edit.Toolbar
Assembly: ToSic.Sxc.dll
Syntax
[PublicApi]
public interface IToolbarBuilder : IHasLog
Remarks
Your code cannot construct this object by itself, as it usually needs additional information.
To get a ToolbarBuilder
, use the IToolbarService.
History
- Added in 2sxc 13, just minimal API
- massively enhanced in v14.04
- most commands extended with Tweak API in v15.07
Methods
| Improve this Doc View SourceAdd(object, string, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create button to add a new entity to a list of entities. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder Add(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", string contentType = null, Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | optional entity-like target which is in a list of items in on a content-block, see target guide |
string | noParamOrder | |
string | contentType | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
AddExisting(object, string, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create button to add an existing entity to the list. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder AddExisting(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", string contentType = null, Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | optional entity-like target which is in a list of items in on a content-block, see target guide |
string | noParamOrder | |
string | contentType | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
App(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create button to admin the app. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder App(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | not used ATM just here for API consistency |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen. By default, the button will show based on conditions like permissions. |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
AppImport(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create button to open the import-app dialog. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder AppImport(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | not used ATM just here for API consistency |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen. By default, the button will show based on conditions like permissions. |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
AppResources(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create button to edit the app resources if there are any. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder AppResources(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | not used ATM just here for API consistency |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen. By default, the button will show based on conditions like permissions. |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
AppSettings(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create button to edit the custom app settings if there are any. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder AppSettings(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | not used ATM just here for API consistency |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen. By default, the button will show based on conditions like permissions. |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Apps(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create button to open the apps management of the current site. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder Apps(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | not used ATM just here for API consistency |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen. By default, the button will show based on conditions like permissions. |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
AsAttributes(object)
Get a toolbar builder which would render to HTML as attributes on an existing tag. Note that this is the default, so you will usually not need this.
Declaration
IToolbarBuilder AsAttributes(object target = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | optional entity-like target, see target guide |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
AsTag(object)
Get a toolbar builder which would render to HTML as a standalone tag.
Important: Toolbars created using this will behave differently from previous standalone toolbars. These standalone toolbars will not float automatically as previous ones did. You can still get them to float by adjusting the Settings as you need them.
This is because many years ago, standalone toolbars were configured floated automatically. As the APIs got better, this wasn't a great default any more, but we couldn't introduce a breaking change. Anything created now with this new API will be new, so this will behave more in line with expectations. See also issue
Declaration
IToolbarBuilder AsTag(object target = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | optional entity-like target, see target guide |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Button(string, object, string, Func<ITweakButton, ITweakButton>, object, object, string, string)
Add a custom button / command. Can also be used to do advanced remove operations or modify a button on a toolbar which would have it by default.
Declaration
IToolbarBuilder Button(string name, object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null, string context = null)
Parameters
Type | Name | Description |
---|---|---|
string | name |
|
object | target | optional entity-like target, see target guide |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen |
string | context |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Code(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create Button to run JS code. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder Code(object target, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | Name of the function to call, without parameters. |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Condition(bool)
Condition to apply if the toolbar would show, but maybe shouldn't. For example, you can prevent the toolbar from appearing if it's the Demo-Item.
For expensive conditions, use the overload which accepts a function.
Declaration
IToolbarBuilder Condition(bool condition)
Parameters
Type | Name | Description |
---|---|---|
bool | condition | true/false |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Remarks
New in v14.04
Condition(Func<bool>)
Condition to apply if the toolbar would show, but maybe shouldn't. For example, you can prevent the toolbar from appearing if it's the Demo-Item.
This accepts a function to check the condition. It will only run if the toolbar would already show.
Declaration
IToolbarBuilder Condition(Func<bool> condition)
Parameters
Type | Name | Description |
---|---|---|
Func<bool> | condition | function such as |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Remarks
New in v14.04
Copy(object, string, Func<ITweakButton, ITweakButton>, string, object, object, object, string, string)
Create button to copy an item. Can also be used to remove the same button on a toolbar which would have it by default. It needs the item which it will copy as a parameter.
Declaration
IToolbarBuilder Copy(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, string contentType = null, object ui = null, object parameters = null, object prefill = null, string operation = null, string context = null)
Parameters
Type | Name | Description |
---|---|---|
object | target |
|
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
string | contentType | |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
object | prefill | optional prefill for the edit-UI, see prefill guide |
string | operation | optional change what should happen |
string | context | EXPERIMENTAL - not final |
Returns
Type | Description |
---|---|
IToolbarBuilder | A new toolbar builder which has been extended with this button |
Remarks
Added in v14.02
Data(object, string, Func<ITweakButton, ITweakButton>, object, object, object, string)
Create button to show a data-admin dialog with all the data-items / entities of a specific content type. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder Data(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object filter = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | 3 Options:
|
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | filter | object or string with the filters for the data view see filter |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Delete(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create (or reconfigure) the button to delete an item.
This has a special behavior.
The default
toolbar already includes a delete-button in the third group.
So if the toolbar is is a default
this will just modify it to force-show.
But it will still be in the third group of buttons.
For the empty
toolbar it will just add the button in the normal way.
To change this automatic behavior, use a operation
= modify
or add
Declaration
IToolbarBuilder Delete(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | optional entity-like target, see target guide |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
DetectDemo(ICanBeEntity, string, string)
Detect if the toolbar should go into demo-mode.
Declaration
[InternalApi_DoNotUse_MayChangeWithoutNotice("WIP 16.02")]
IToolbarBuilder DetectDemo(ICanBeEntity root, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", string message = null)
Parameters
Type | Name | Description |
---|---|---|
ICanBeEntity | root | |
string | noParamOrder | |
string | message | Optional message or a resources key such as |
Returns
Type | Description |
---|---|
IToolbarBuilder |
Edit(object, string, Func<ITweakButton, ITweakButton>, object, object, object, string)
Create button to edit an item. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder Edit(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, object prefill = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | optional entity-like target, see target guide |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
object | prefill | optional prefill for the edit-UI, see prefill guide |
string | operation | optional change what should happen |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Fields(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create Button to open a dialog to manage the fields/attributes of the content type. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder Fields(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
For(object)
Set the main target of this toolbar.
Declaration
IToolbarBuilder For(object target)
Parameters
Type | Name | Description |
---|---|---|
object | target | optional entity-like target, see target guide |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Remarks
New in v14.04
Group(string)
Adds a button group to the toolbar. All following buttons will be in this group automatically.
Can also be used to remove a group of buttons on the default
toolbar, such as the group view
.
See list of groups on default
Declaration
IToolbarBuilder Group(string name = null)
Parameters
Type | Name | Description |
---|---|---|
string | name | optional - name of new group or |
Returns
Type | Description |
---|---|
IToolbarBuilder |
Remarks
New in v14.08
Info(string, string, Func<ITweakButton, ITweakButton>)
Create an info, warning, help or link-button to assist the user.
Declaration
IToolbarBuilder Info(string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", string link = null, Func<ITweakButton, ITweakButton> tweak = null)
Parameters
Type | Name | Description |
---|---|---|
string | noParamOrder | |
string | link | If provided, will make the button open the link in a new window. |
Func<ITweakButton, ITweakButton> | tweak | Optional function call to tweak the button. |
Returns
Type | Description |
---|---|
IToolbarBuilder |
Remarks
- Added in v15.07
Insights(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create button to open the insights for debugging. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder Insights(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | not used ATM just here for API consistency |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen. By default, the button will show based on conditions like permissions. |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Layout(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create Button to change the view/layout of the data shown on the page. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder Layout(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | not used ATM just here for API consistency |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
List(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create button to manage the list of entities shown here. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder List(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | optional entity-like target which is in a list of items in on a content-block, see target guide |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Metadata(object, string, string, Func<ITweakButton, ITweakButton>, object, object, object, string, string)
Create button to add or edit metadata to the specified object and using the content-type specified here. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder Metadata(object target, string contentTypes = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, object prefill = null, string operation = null, string context = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | The target object which should receive metadata. Must support IHasMetadata. Often an entity-like target, see target guide, but can also other metadata supporting objects, like an Asset, Page, Site, etc. |
string | contentTypes | Name of one or more content-types for which to generate the button(s). For many, use comma |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
object | prefill | optional prefill for the edit-UI, see prefill guide |
string | operation | optional change what should happen |
string | context | EXPERIMENTAL - not final |
Returns
Type | Description |
---|---|
IToolbarBuilder | A new toolbar builder which has been extended with this button |
Remarks
History
- Added in 2sxc 13
- contentTypes changed from one to many in v14
- contentTypes can also have
*
orSomeType,*
in v14 - contentTypes can also be optional, in which case it behaves as if it was
*
in v14 - if no config is found, it will not add a metadata-button - parameter context added in 2sxc 14 - still WIP/experimental
- changed ui and parameters to support object in v14.04
More(string, object)
Add a more
button. Not really useful to do, but included for completeness
Declaration
IToolbarBuilder More(string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", object ui = null)
Parameters
Type | Name | Description |
---|---|---|
string | noParamOrder | |
object | ui | optional configuration how to show, see ui guide |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
MoveDown(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create button to move an item down in a list. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder MoveDown(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | optional entity-like target which is in a list of items in on a content-block, see target guide |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
MoveUp(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create button to move an item up in a list. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder MoveUp(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | optional entity-like target which is in a list of items in on a content-block, see target guide |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
New(object, string, Func<ITweakButton, ITweakButton>, object, object, object, string)
Create button to create a new item. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder New(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, object prefill = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | X Options
|
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
object | prefill | optional prefill for the edit-UI, see prefill guide |
string | operation | optional change what should happen |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Parameters(object, string, Func<ITweakButton, ITweakButton>, object, object, object, string)
Adds / updates the params
rule on the toolbar which contains information for all the buttons
Declaration
IToolbarBuilder Parameters(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, object prefill = null, string context = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | Many options
|
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v16.02) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
object | prefill | optional prefill for the edit-UI, see prefill guide |
string | context |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Publish(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create button to publish the current item.
Can also be used to remove the same button on a toolbar which would have it by default.
By default it will only appear if the current item is draft/unpublished.
You can change this (but probably shouldn't) by setting an operation
.
Declaration
IToolbarBuilder Publish(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | optional entity-like target, see target guide |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Query(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create Button to open the design/edit query dialog. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder Query(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Remove(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create button to remove an item from a list. Can also be used to remove the same button on a toolbar which would have it by default. This will not delete the item, just remove.
Declaration
IToolbarBuilder Remove(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | optional entity-like target which is in a list of items in on a content-block, see target guide |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Replace(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create button to replace the current item in the list with another existing item. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder Replace(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | optional entity-like target which is in a list of items in on a content-block, see target guide |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Settings(string, string, string, string, string, string, object, object)
Add a settings
rule to configure what the toolbar should look like. See Toolbar Settings
Declaration
IToolbarBuilder Settings(string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", string show = null, string hover = null, string follow = null, string classes = null, string autoAddMore = null, object ui = null, object parameters = null)
Parameters
Type | Name | Description |
---|---|---|
string | noParamOrder | |
string | show |
|
string | hover |
|
string | follow | |
string | classes | css class names to add to the entire toolbar |
string | autoAddMore | placement of the more ellipsis button, |
object | ui | optional configuration how to show, see ui guide |
object | parameters | Parameters for the command - doesn't really have an effect on Settings, but included for consistency |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Remarks
History
- Added in 2sxc 13
- options
auto
andnever
on autoAddMore added in 14.08
System(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create button to open the system admin dialog. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder System(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | not used ATM just here for API consistency |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen. By default, the button will show based on conditions like permissions. |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
Template(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create Button to open the edit-template (source-code) dialog. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder Template(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |
View(object, string, Func<ITweakButton, ITweakButton>, object, object, string)
Create Button to open the edit view settings dialog. Can also be used to remove the same button on a toolbar which would have it by default.
Declaration
IToolbarBuilder View(object target = null, string noParamOrder = "Params must be named (https://go.2sxc.org/named-params)", Func<ITweakButton, ITweakButton> tweak = null, object ui = null, object parameters = null, string operation = null)
Parameters
Type | Name | Description |
---|---|---|
object | target | |
string | noParamOrder | |
Func<ITweakButton, ITweakButton> | tweak | Functional Tweak API to modify UI and parameters (new v15.07) |
object | ui | optional configuration how to show, see ui guide |
object | parameters | optional parameters for the command, see parameters guide |
string | operation | optional change what should happen |
Returns
Type | Description |
---|---|
IToolbarBuilder | a new toolbar builder - see guide |