Skip to content

Instantly share code, notes, and snippets.

@johanjanssens
Created July 22, 2020 23:45
Show Gist options
  • Save johanjanssens/8c3fba5bce99592a3ce181759d8d22be to your computer and use it in GitHub Desktop.
Save johanjanssens/8c3fba5bce99592a3ce181759d8d22be to your computer and use it in GitHub Desktop.
We also support shortcodes for all our blocks.
There is one caveat, page blocks can **only** be added on pages, not posts. At this time, this means list block can only be added to pages.
## Shortcode examples
### List block
`[docman-list page_category=123 layout=gallery download_in_blank_page=1]`
#### Supported attributes
* **page_category**: category ID or UUID to list categories from. You can go to Categories in DOCman backend, edit a category and see the ID in the URL. Optional, defaults to all categories.
* **layout**: Page layout. It can be one of `table`, `default`, or `gallery`. Defaults to `preview`.
* **link_to**: Link to direct download or preview page. It can be one of `download` or `preview`. Defaults to `download`.
* **download_in_blank_page**: Open download links in new tab. It can either be `0` or `1`. Defaults to `0`.
* **show_document_size**: Show document size. It can either be `0` or `1`. Defaults to `1`.
* **show_document_hits**: Show document downloads. It can either be `0` or `1`. Defaults to `1`.
* **show_document_extension**: Show document extension. It can either be `0` or `1`. Defaults to `1`.
* **allow_multi_download**: Allow multiple file download. It can either be `0` or `1`. Defaults to `1`.
* **force_download**: Force download all files. It can either be `0` or `1`. Defaults to `0`.
* **sort_documents**: Document order. It can be one of `title`, `reverse_title`, `created_on`, `reverse_created_on`, `reverse_hits`, `reverse_touched_on`, or `ordering` . Defaults to `title`.
* **sort_categories**: Category order. It can be one of `title`, `reverse_title`, `created_on`, `reverse_created_on`, or `ordering` . Defaults to `title`.
### Attachment block
`[docman-doclink documents=123,456 layout=gallery download_in_blank_page=1]`
#### Supported attributes
* **documents**: Document IDs to attach, separated by comma. Required attribute.
* **layout**: Page layout. It can be one of `table`, `default`, or `gallery`. Defaults to `preview`.
* **link_to**: Link to direct download or preview page. It can be one of `download` or `preview`. Defaults to `download`.
* **download_in_blank_page**: Open download links in new tab. It can either be `0` or `1`. Defaults to `0`.
* **show_document_size**: Show document size. It can either be `0` or `1`. Defaults to `1`.
* **show_icon**: Show document icon. It can either be `0` or `1`. Defaults to `1`.
* **show_document_extension**: Show document extension. It can either be `0` or `1`. Defaults to `1`.
* **allow_multi_download**: Allow multiple file download. It can either be `0` or `1`. Defaults to `1`.
* **force_download**: Force download all files. It can either be `0` or `1`. Defaults to `0`.
* **sort_documents**: Document order. It can be one of `title`, `reverse_title`, `created_on`, `reverse_created_on`, `reverse_hits`, `reverse_touched_on`, or `ordering` . Defaults to `title`.
* **sort_categories**: Category order. It can be one of `title`, `reverse_title`, `created_on`, `reverse_created_on`, or `ordering` . Defaults to `title`.
### Accept documents block
`[docman-submit category_id=123]`
#### Supported attributes
* **category_id**: Category ID to send documents to.
* **category_children**: Show child categories. It can either be `0` or `1`. Defaults to `1`.
* **auto_publish**: Publish automatically. It can either be `0` or `1`. Defaults to `0`.
* **show_description**: Show description. It can either be `0` or `1`. Defaults to `0`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment