#### <[...Prev](reference.md "Back to Reference")> <[Contents](../README.md)>

---

## BlockCategory

### 4.1

#### Lists

List all categories:

```shell
wm-cli blockCategory list
```

Result:

```json
{
  "data": [
    {"_id": "banner", "name": "Banner"},
    {"_id": "blogs", "name": "Blogs"},
    {"_id": "contact-forms", "name": "Contact Forms"},
    {"_id": "cta", "name": "CTA"},
    {"_id": "footer", "name": "Footer"},
    {"_id": "gallery", "name": "Gallery"},
    {"_id": "header", "name": "Header"},
    {"_id": "maps", "name": "Maps"},
    {"_id": "news", "name": "News"},
    {"_id": "quotes", "name": "Quotes"},
    {"_id": "slider", "name": "Slider"},
    {"_id": "story", "name": "Story"},
    {"_id": "subscribtion-form", "name": "Subscribtion Form"},
    {"_id": "team", "name": "Team"},
    {"_id": "testmonials", "name": "Testmonials"},
    {"_id": "video", "name": "Video"}
  ],
  "skip": 0,
  "total": 16,
  "now": 1510040716220,
  "messageId": 6,
  "status": 200,
  "request": {
    "query": {
      "filter": {},
      "skip": 0,
      "limit": 50
    },
    "action": "blockCategory.list",
    "messageId": 6
  }
}
```

List initial categories these can not be removed:

```shell
wm-cli blockCategory initial
```

Result:

```json
{
  "data": [
    {"_id": "story", "name": "Story"},
    {"_id": "header", "name": "Header"},
    {"_id": "banner", "name": "Banner"},
    {"_id": "blogs", "name": "Blogs"},
    {"_id": "team", "name": "Team"},
    {"_id": "footer", "name": "Footer"},
    {"_id": "contact-forms", "name": "Contact Forms"},
    {"_id": "subscribtion-form", "name": "Subscribtion Form"},
    {"_id": "gallery", "name": "Gallery"},
    {"_id": "slider", "name": "Slider"},
    {"_id": "cta", "name": "CTA"},
    {"_id": "video", "name": "Video"},
    {"_id": "maps", "name": "Maps"},
    {"_id": "testmonials", "name": "Testmonials"},
    {"_id": "news", "name": "News"},
    {"_id": "quotes", "name": "Quotes"}
  ],
  "now": 1510040873468,
  "messageId": 6,
  "status": 200,
  "request": {
    "action": "blockCategory.listInitial",
    "messageId": 6
  }
}
```

### 4.2

#### Save/Remove

Save categoty with id and name. Creates new category if that does not exist:

```shell
wm-cli blockCategory save test Test
```

Result:

```json
{
  "data": {
    "n": 1,
    "nModified": 0,
    "upserted": [
      {

        "index": 0,
        "_id": "test"
      }
    ],
    "ok": 1
  },
  "now": 1510041077309,
  "messageId": 6,
  "status": 200,
  "request": {
    "id": "test",
    "data": {
      "name": "Test"
    },
    "action": "blockCategory.save",
    "messageId": 6
  }
}
```

Remove categoty by id.

```shell
wm-cli blockCategory rm test
```

Result:

```json
{
  "data": {
    "n": 1,
    "ok": 1
  },
  "now": 1510041254296,

  "messageId": 6,
  "status": 200,
  "request": {
    "id": "test",
    "action": "blockCategory.remove",
    "messageId": 6
  }
}
```

---

<[...Prev](reference.md "Back to Reference")> <[Contents](../README.md)>
