• Basics
  • Abyss
  • Web APIs
  • C# & Razor
  • .net API
  • JS & TS API
Search Results for

    Show / Hide Table of Contents

    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.

    📖 See Guide for the Toolbar Builder

    Inherited Members
    IHasLog.Log
    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.

    • uses the Convention: Functional API (Immutable)

    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 Source

    Add(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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    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
    1. The required name of the command. See CommandNames.

    2. Can also be a full rule-string containing parameters and more according to the conventions of the js toolbar

    object target

    optional entity-like target, see target guide

    string noParamOrder

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    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 () => true

    Returns
    Type Description
    IToolbarBuilder

    a new toolbar builder - see guide

    Remarks

    New in v14.04

    | Improve this Doc View Source

    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
    • an entity-like target, see target guide
    • can also be a int (number) entityId. If you only supply the entity ID, you must also supply the contentType.
    string noParamOrder

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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:

    • an entity-like target, see target guide
    • a string containing the type name
    • a modifier keyword such as remove or - to remove the button
    string noParamOrder

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    string message

    Optional message or a resources key such as Resources.ToolbarShowingDemo

    Returns
    Type Description
    IToolbarBuilder
    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    | Improve this Doc View Source

    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 -name to remove an existing group.

    Returns
    Type Description
    IToolbarBuilder
    Remarks

    New in v14.08

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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
    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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 , to separate. If not specified, will try to lookup config (v14)

    string noParamOrder

    see Convention: Named Parameters

    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 * or SomeType,* 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
    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    object ui

    optional configuration how to show, see ui guide

    Returns
    Type Description
    IToolbarBuilder

    a new toolbar builder - see guide

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    • an entity-like target, see target guide
    • a string with the content-type name
    string noParamOrder

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    1. An Entity-like thing which would be used to prepare default params like entityId
    2. A string, which would be the same as using the term on the parameters
    3. A object - especially an anonymous object like new { id = 7, show = true }
    string noParamOrder

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    string show

    hover (default), always

    string hover

    right (default), left

    string follow
    string classes

    css class names to add to the entire toolbar

    string autoAddMore

    placement of the more ellipsis button, auto (default), end, start, never

    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 and never on autoAddMore added in 14.08
    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    | Improve this Doc View Source

    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

    see Convention: Named Parameters

    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

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX