Skip to content

Compendium

compendiumAttributes

Creates a set of compendium drop target attributes. Defaults to creating target attributes for the Name and data compendium attributes.

  • prefix - string -

    A prefix to attach to the default attribute names.

  • lookupAttributes - array -

    An array of the lookup attributes to create targets for. The target attributes are named based on the compendium attribute they are for.

  • triggerAccept - string -

    The compendium attribute that should trigger the sheetworkers to handle the compendium drop.

  • trigger - object -

    The trigger object.

Example

pug
include k-scaffold
//Using just defaults
+compendiumAttributes({})

//Specifying a prefix
+compendiumAttributes({prefix:'prefix'})

//Specifying lookupAttributes and a prefix
+compendiumAttributes({lookupAttributes:['Name','data','Category'],prefix:'prefix'})
include k-scaffold
//Using just defaults
+compendiumAttributes({})

//Specifying a prefix
+compendiumAttributes({prefix:'prefix'})

//Specifying lookupAttributes and a prefix
+compendiumAttributes({lookupAttributes:['Name','data','Category'],prefix:'prefix'})

Output

html
<button name="act_k-network-call" hidden="" type="action"></button>
<!--Using just defaults-->
<input name="attr_drop_name" accept="Name" value="" type="hidden" title="@{drop_name}"/>
<input name="attr_drop_data" accept="data" value="" type="hidden" title="@{drop_data}"/>
<!--Specifying a prefix-->
<input name="attr_prefix_drop_name" accept="Name" value="" type="hidden" title="@{prefix_drop_name}"/>
<input name="attr_prefix_drop_data" accept="data" value="" type="hidden" title="@{prefix_drop_data}"/>
<!--Specifying lookupAttributes and a prefix-->
<input name="attr_prefix_drop_name" accept="Name" value="" type="hidden" title="@{prefix_drop_name}"/>
<input name="attr_prefix_drop_data" accept="data" value="" type="hidden" title="@{prefix_drop_data}"/>
<input name="attr_prefix_drop_category" accept="Category" value="" type="hidden" title="@{prefix_drop_category}"/>
<button name="act_k-network-call" hidden="" type="action"></button>
<!--Using just defaults-->
<input name="attr_drop_name" accept="Name" value="" type="hidden" title="@{drop_name}"/>
<input name="attr_drop_data" accept="data" value="" type="hidden" title="@{drop_data}"/>
<!--Specifying a prefix-->
<input name="attr_prefix_drop_name" accept="Name" value="" type="hidden" title="@{prefix_drop_name}"/>
<input name="attr_prefix_drop_data" accept="data" value="" type="hidden" title="@{prefix_drop_data}"/>
<!--Specifying lookupAttributes and a prefix-->
<input name="attr_prefix_drop_name" accept="Name" value="" type="hidden" title="@{prefix_drop_name}"/>
<input name="attr_prefix_drop_data" accept="data" value="" type="hidden" title="@{prefix_drop_data}"/>
<input name="attr_prefix_drop_category" accept="Category" value="" type="hidden" title="@{prefix_drop_category}"/>

compendiumContainer

Creates a set of compendium drop target attributes and a container to target with the drag and drop. Defaults to creating target attributes for the Name and data compendium attributes.

  • prefix - string -

    A prefix to attach to the default attribute names.

  • lookupAttributes - array -

    An array of the lookup attributes to create targets for. The target attributes are named based on the compendium attribute they are for.

  • triggerAccept - string -

    The compendium attribute that should trigger the sheetworkers to handle the compendium drop.

  • trigger - object -

    The trigger object.

  • vttCategories - -

    The compendium categories that could be dropped directly to the VTT (e.g. NPCs in the 5e compendium).

Example

pug
include k-scaffold
//Using default compendium attributes and defining categories for direct vtt drop.
+compendiumContainer({
  vttCategories:['npcs','vehicles']
})
  |Sheet content here
include k-scaffold
//Using default compendium attributes and defining categories for direct vtt drop.
+compendiumContainer({
  vttCategories:['npcs','vehicles']
})
  |Sheet content here

Output

html
<button name="act_k-network-call" hidden="" type="action"></button>
<!--Using default compendium attributes and defining categories for direct vtt drop.-->
<div class="compendium-drop-target npcs vehicles">
  <input name="attr_drop_name" accept="Name" value="" type="hidden" title="@{drop_name}"/>
  <input name="attr_drop_data" accept="data" value="" type="hidden" title="@{drop_data}"/>
  Sheet content here
</div>
<button name="act_k-network-call" hidden="" type="action"></button>
<!--Using default compendium attributes and defining categories for direct vtt drop.-->
<div class="compendium-drop-target npcs vehicles">
  <input name="attr_drop_name" accept="Name" value="" type="hidden" title="@{drop_name}"/>
  <input name="attr_drop_data" accept="data" value="" type="hidden" title="@{drop_data}"/>
  Sheet content here
</div>

Released under the MIT License