<commit_before>---
title: "Misc"
---

TODO: is there a theme here?

### Showing Custom Fields In The "Manage" View

By default the "manage" view shows only the title, the tags, and whether the item is currently in the trash or not.

You can extend this by setting the `manage: true` property on your fields and overriding the `manage.html` template. You'll need to copy that template from the `views/manage.html` file of the `apostrophe-snippets` module to the corresponding location for your module, which might be `lib/modules/myThing/views/manage.html`.

In the `manage.html` template, just include additional table cells for each row, like this one:

        <td><span data-key>Sample Key</span></td>

If there is a schema field named `key`, then its value will be displayed in this span.

The data attribute name `always-uses-hyphens`, `neverEverIntercap` `or_underscores`.

This feature is currently available for fields that correspond to simple form elements, like `boolean`, `string`, `date`, `time` and `select`. It is not currently available for joins, areas or singletons. It may become available for certain singletons (like thumbnails) and one-to-one joins in the future.

### Blocking Search

By default your content type is searchable. This is great, but sometimes you won't want it to be. To achieve that, set the `searchable: false` option when configuring your module.

### Restricting Edits To Admins Only

Sometimes your content type is too important to allow anyone except a site-wide admin permission to edit it. In such cases, just set the `adminOnly: true` option.<commit_msg>How to make the permissions of a snippet editable<commit_after>---
title: "Misc"
---

TODO: is there a theme here?

### Showing Custom Fields In The "Manage" View

By default the "manage" view shows only the title, the tags, and whether the item is currently in the trash or not.

You can extend this by setting the `manage: true` property on your fields and overriding the `manage.html` template. You'll need to copy that template from the `views/manage.html` file of the `apostrophe-snippets` module to the corresponding location for your module, which might be `lib/modules/myThing/views/manage.html`.

In the `manage.html` template, just include additional table cells for each row, like this one:

        <td><span data-key>Sample Key</span></td>

If there is a schema field named `key`, then its value will be displayed in this span.

The data attribute name `always-uses-hyphens`, `neverEverIntercap` `or_underscores`.

This feature is currently available for fields that correspond to simple form elements, like `boolean`, `string`, `date`, `time` and `select`. It is not currently available for joins, areas or singletons. It may become available for certain singletons (like thumbnails) and one-to-one joins in the future.

### Blocking Search

By default your content type is searchable. This is great, but sometimes you won't want it to be. To achieve that, set the `searchable: false` option when configuring your module.

### Restricting Edits To Admins Only

Sometimes your content type is too important to allow anyone except a site-wide admin permission to edit it. In such cases, just set the `adminOnly: true` option.

### Allowing users to change the editing permissions of a snippet

By default, a snippet can be edited by the person who created it, by people who have the admin permission for that type of snippets, and by sitewide admins.

If you wish, you can enable the permissions for individual snippets to be edited. This is useful if your users need to share responsibility for editing events, for instance.

You enable this by adding a field of the appropriate type to the schema:

```javascript
'apostrophe-snippets': {
  addFields: [
    {
      type: 'a2SnippetPermissions',
      label: 'Permissions',
      name: 'permissions'
    }
  ]
}
```

Note that when you do this, any user who is permitted to edit the snippet can change the permissions of the snippet. However, no matter what they do, admins will still be able to edit the snippet.

{'fraction_non_alphanumeric': 0.07135850907307503, 'fraction_numerical': 0.0002452182442373713, 'mean_word_length': 4.2700258397932815, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '634633', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1048, 'n_words': 599}