Table of Contents

Interface CommandDataParams

Parameters used for the command data.
The content-type name determines what items will be managed.
⤴️ back to All Command Names

CMS Command contentitems

you are here (click to zoom) - discover the stack

This button opens the admin-dialog with all content-items. It has a feature which also allows you to add filters.

TODO: UPDATE TO SHOW MODERN TOOLBAR + USE ID Array of items in v14.02

How to use

Here's a basic example showing a 2sxc-toolbar with a custom code:

@* Example using hover TagToolbar (recommended) *@
<div @Edit.TagToolbar(toolbar: new {
    action = "contentitems",
    contentType= "Tag",
    filters = new {  ManualWeight = 2 })>
...
</div>

@* Example using inline Toolbar (not recommended) *@
<div>
    @Edit.Toolbar(toolbar: new {
        action = "contentitems",
        contentType= "Tag",
        filters = new {  ManualWeight = 2 })
...
</div>

This shows a button which opens the table with all Tag items and filters for ManualWeight = 2. Let's try a more complex setup:

@* Example using hover TagToolbar (recommended) *@
<div @Edit.TagToolbar(
    toolbar: new object[] {
        new { action = "contentitems",
            contentType= "Tag",
            filters = new {  ManualWeight = 2 }
        },
        new { action = "contentitems",
            contentType= "BlogPost",
            filters = new {Tags = new[] { tag.Tag } }
        }
    },
    settings: new { show = "always" })>
...
</div>

This shows 2sxc-toolbar with 2 buttons, one opening tag-management (filtered by ManualWeight), the other opens all BlogPosts filtering by Tag. It also has some settings which always show it, even if the mouse is not hovering.

Possible filters on contentitems

The filters-object is a JS-object with properties. We're still working on the format, but for now it's probably

  1. NumberPropertyName: ##
  2. StringPropertyName: "..."
  3. BoolPropertyName: true
  4. EntityPropertyName: ["title1", "title2", ...] list of values to check
  5. EntityPropertyName: [ 203004, 40203 ] // list of IDs to check
  6. IsPublished: true
  7. IsMetadata: true

Read also

  • Mobius Forms uses the contentitems command to let the admin see the forms-records for his use case only

History

  1. Introduced in 2sxc v08.06
  2. Filters introduced in 2sxc v08.08
  3. Filters improved to support id-array in v13.0
  4. Code improved in v14.02 so new toolbar syntax with contentitems?filter:parent=[5030] works - before this didn't work as expected

Package: Api.Js.SxcJs

Properties

contentType

The content-type name

CMS Command contentitems

you are here (click to zoom) - discover the stack

This button opens the admin-dialog with all content-items. It has a feature which also allows you to add filters.

TODO: UPDATE TO SHOW MODERN TOOLBAR + USE ID Array of items in v14.02

How to use

Here's a basic example showing a 2sxc-toolbar with a custom code:

@* Example using hover TagToolbar (recommended) *@
<div @Edit.TagToolbar(toolbar: new {
    action = "contentitems",
    contentType= "Tag",
    filters = new {  ManualWeight = 2 })>
...
</div>

@* Example using inline Toolbar (not recommended) *@
<div>
    @Edit.Toolbar(toolbar: new {
        action = "contentitems",
        contentType= "Tag",
        filters = new {  ManualWeight = 2 })
...
</div>

This shows a button which opens the table with all Tag items and filters for ManualWeight = 2. Let's try a more complex setup:

@* Example using hover TagToolbar (recommended) *@
<div @Edit.TagToolbar(
    toolbar: new object[] {
        new { action = "contentitems",
            contentType= "Tag",
            filters = new {  ManualWeight = 2 }
        },
        new { action = "contentitems",
            contentType= "BlogPost",
            filters = new {Tags = new[] { tag.Tag } }
        }
    },
    settings: new { show = "always" })>
...
</div>

This shows 2sxc-toolbar with 2 buttons, one opening tag-management (filtered by ManualWeight), the other opens all BlogPosts filtering by Tag. It also has some settings which always show it, even if the mouse is not hovering.

Possible filters on contentitems

The filters-object is a JS-object with properties. We're still working on the format, but for now it's probably

  1. NumberPropertyName: ##
  2. StringPropertyName: "..."
  3. BoolPropertyName: true
  4. EntityPropertyName: ["title1", "title2", ...] list of values to check
  5. EntityPropertyName: [ 203004, 40203 ] // list of IDs to check
  6. IsPublished: true
  7. IsMetadata: true

Read also

  • Mobius Forms uses the contentitems command to let the admin see the forms-records for his use case only

History

  1. Introduced in 2sxc v08.06
  2. Filters introduced in 2sxc v08.08
  3. Filters improved to support id-array in v13.0
  4. Code improved in v14.02 so new toolbar syntax with contentitems?filter:parent=[5030] works - before this didn't work as expected

Declaration
contentType: string
Property Value
Type Description
string

filters

Filters to apply to the list of items.
Each property targets a field. The value is a string, number or array for filtering EntityIds or EntityGuids

CMS Command contentitems

you are here (click to zoom) - discover the stack

This button opens the admin-dialog with all content-items. It has a feature which also allows you to add filters.

TODO: UPDATE TO SHOW MODERN TOOLBAR + USE ID Array of items in v14.02

How to use

Here's a basic example showing a 2sxc-toolbar with a custom code:

@* Example using hover TagToolbar (recommended) *@
<div @Edit.TagToolbar(toolbar: new {
    action = "contentitems",
    contentType= "Tag",
    filters = new {  ManualWeight = 2 })>
...
</div>

@* Example using inline Toolbar (not recommended) *@
<div>
    @Edit.Toolbar(toolbar: new {
        action = "contentitems",
        contentType= "Tag",
        filters = new {  ManualWeight = 2 })
...
</div>

This shows a button which opens the table with all Tag items and filters for ManualWeight = 2. Let's try a more complex setup:

@* Example using hover TagToolbar (recommended) *@
<div @Edit.TagToolbar(
    toolbar: new object[] {
        new { action = "contentitems",
            contentType= "Tag",
            filters = new {  ManualWeight = 2 }
        },
        new { action = "contentitems",
            contentType= "BlogPost",
            filters = new {Tags = new[] { tag.Tag } }
        }
    },
    settings: new { show = "always" })>
...
</div>

This shows 2sxc-toolbar with 2 buttons, one opening tag-management (filtered by ManualWeight), the other opens all BlogPosts filtering by Tag. It also has some settings which always show it, even if the mouse is not hovering.

Possible filters on contentitems

The filters-object is a JS-object with properties. We're still working on the format, but for now it's probably

  1. NumberPropertyName: ##
  2. StringPropertyName: "..."
  3. BoolPropertyName: true
  4. EntityPropertyName: ["title1", "title2", ...] list of values to check
  5. EntityPropertyName: [ 203004, 40203 ] // list of IDs to check
  6. IsPublished: true
  7. IsMetadata: true

Read also

  • Mobius Forms uses the contentitems command to let the admin see the forms-records for his use case only

History

  1. Introduced in 2sxc v08.06
  2. Filters introduced in 2sxc v08.08
  3. Filters improved to support id-array in v13.0
  4. Code improved in v14.02 so new toolbar syntax with contentitems?filter:parent=[5030] works - before this didn't work as expected

Declaration
filters?: Record<string, string | number | string[] | number[]>
Property Value
Type Description
Record<string, string | number | string[] | number[]>