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
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
- NumberPropertyName: ##
- StringPropertyName:
"..."
- BoolPropertyName:
true
- EntityPropertyName:
["title1", "title2", ...]
list of values to check - EntityPropertyName:
[ 203004, 40203 ]
// list of IDs to check - IsPublished: true
- IsMetadata: true
Read also
Demo App and further links
- Mobius Forms uses the contentitems command to let the admin see the forms-records for his use case only
History
- Introduced in 2sxc v08.06
- Filters introduced in 2sxc v08.08
- Filters improved to support id-array in v13.0
- 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
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
- NumberPropertyName: ##
- StringPropertyName:
"..."
- BoolPropertyName:
true
- EntityPropertyName:
["title1", "title2", ...]
list of values to check - EntityPropertyName:
[ 203004, 40203 ]
// list of IDs to check - IsPublished: true
- IsMetadata: true
Read also
Demo App and further links
- Mobius Forms uses the contentitems command to let the admin see the forms-records for his use case only
History
- Introduced in 2sxc v08.06
- Filters introduced in 2sxc v08.08
- Filters improved to support id-array in v13.0
- 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
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
- NumberPropertyName: ##
- StringPropertyName:
"..."
- BoolPropertyName:
true
- EntityPropertyName:
["title1", "title2", ...]
list of values to check - EntityPropertyName:
[ 203004, 40203 ]
// list of IDs to check - IsPublished: true
- IsMetadata: true
Read also
Demo App and further links
- Mobius Forms uses the contentitems command to let the admin see the forms-records for his use case only
History
- Introduced in 2sxc v08.06
- Filters introduced in 2sxc v08.08
- Filters improved to support id-array in v13.0
- 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[]> |