type: URL, required: yes, default: -
The endpoint to use, e.g. http://your.celum.server/anura/first
type: String, required: no, default: CELUM's default language
The locale (ISO 639-1) to use, i.e. en
. The availability of these depend on your CELUM configuration, usually en, de or fr. When left empty, CELUM's default language will be used.
type: Object, required: yes, default:
{kind: 101, id: 0}
The root node of your tree, i.e. {kind: 103, id: 1337}
. Note that since CELUM 5, the kind-parameter is no longer required unless you set the ID to -1.
type: long, required: only when node.id = -1, default: 101
The NodeTypeId of the desired node. Traditionally folder = 101, collection = 102 and keywords = 103, but check your tabconfiguration.xml to be sure. Since CELUM 5 this is only required when you set the node.id to -1.
type: long or array of longs, required: if node is specified, default: 0
The NodeId of the root node(s). Also supports arrays, i.e. you can construct a "virtual root node" (to aggregate multiple nodes from different locations) by using {kind: ..., id: [1, 2, 3]}
. Can also be set to -1
to get all root nodes as long as a kind
is provided (enforces show_root=true; since 1.7).
type: boolean, required: no, default: false
Also show the root node(s) themselves (usually only the child nodes are shown). Probably only useful for virtual root nodes.
type: mixed, required: no, default: false
What to show after the tree has been loaded (triggers an attached main view). One of:
'first' or true
- show the first leaf node in the tree'last'
- show the last leaf node in the tree4123
- an arbitrary ID of a node in the treetype: int, required no, default: 0
Depth to which the tree should be loaded (lazy loading). A depth smaller than one loads the entire tree.
type: String, required: no, default: ''
Prefix for the state fragment in the URL (only needed for multi-instance). Set to false
to completely disable state (deep linking through updating the URL fragment)
type: boolean, required: no, default: false
If the number of assets in each node should be shown. Has some persormance implications for large trees, as every subnode has to be queried individually. Note that if you're using noderef in your main view, you need to also configure noderef: true
here for consistent results.
type: boolean, required: no, default: false
Whether to hide nodes that have an asset_count of 0. Setting this to true
automatically sets asset_count: true
.
type: function or String, required: no, default: null
How the tree should be sorted (per level). Can be either one of id_asc
, name_asc
, info_asc
(or ..._desc
) of a custom comparison function, see MDN
type: function, required: I'd recommend it, default: see below
What should happen when a user clicks on a node in the tree. By default it tries to find the next best gallery component:
callback: function(server, kind, id, name) {
$('.anura-gallery-container').first().parent().anuraGallery({server: server, assets: null, node: {kind: kind, id: id}});
}
If you don't use the gallery or want to be more efficient about it, your code will look something like:
var mainView = $('#your-main-view').anuraGallery({...});
var tree = $('#your-tree').anuraTree({
/*... other settings ... */
callback: function(server, kind, id, name) {
mainView.anuraMasonry({server: server, assets: null, node: {kind: kind, id: id}});
}
});
type: boolean, required: no, default: true
Whether to show the node state (● has subnodes, ○ has no subnodes, ■ lazy loaded) through list styles (since 2.2)
type: boolean, required: no, default: false
Enable folding of the tree (regardless of the current selection) when clicking on the list style icons since 2.3
type: String, required: no, default: null
Adds a custom href attribute to each item in the tree. This is an alternative to the callback, but it's not compatible with the _state_option. since 2.6
type: boolean, required: no, default: false
Enables multi-select on the tree (through CTRL). This is probably only useful then used inside anuraSearch. since 2.7
<div class="anura-tree-container">
<ul>
<li class="anura-node anura-active">
<a><span class="anura-node-name">Parent Node</span></a>
<ul class="anura-tree-unfolded">
<li class="anura-node">
<a><span class="anura-node-name">Child Node</span></a>
<ul class="anura-tree-folded">
<li><!--etc--></li>
</ul>
</li>
<li class="anura-leaf">
<a><span class="anura-node-name">Child Leaf</span></a>
</li>
</ul>
</li>
<li class="anura-node"><!--etc--></li>
<li class="anura-leaf"><!--etc--></li>
<!--etc-->
</ul>
</div>
type: URL, required: yes, default: -
The endpoint to use, e.g. http://your.celum.server/anura/first
type: String, required: no, default: CELUM's default language
The locale (ISO 639-1) to use, i.e. en
. The availability of these depend on your CELUM configuration, usually en, de or fr. When left empty, CELUM's default language will be used.
type: function, required: probably, default: auto-detect a gallery
What to do with the assembled search request, most likely to tell a main view to load that content.
var main = $('#main').anuraGallery(/*...*/);
var search = $('#search').anuraSearch({/*...*/,
callback: function (server, search_query) {
main.anuraGallery({server: server, search: {custom: search_query}, locale: lang});
}
});
type: array of objects, required: yes, default: text and filetype
What search widgets to offer to the user.
General options:
{de: 'German Title', en: 'English Title'}
to override the widget's default titleload chosen.js for pretty dropdowns, it's supported out-of-the-box
Available widgets:
{name: 'text'}
tree
widget instead)
{name: 'filetype', style: 'checkbox'}
checkbox
(default), radio
, select
, dropdown
), how to present the input for the file types{name: 'assettype', style: 'checkbox'}
checkbox
(default), radio
, select
, dropdown
), how to present the input for the asset types{name: 'properties', uploaded: true, modified: true, size: false}
uploaded
, modified
and size
{name: 'tree', root: 1337}
root: -1
false
to suppress){name: 'infofield', id: 123}
checkbox
, radio
, select
and dropdown
checkbox
, radio
, select
, dropdown
, tree
and text
root_node
(long) to set a different root node than the NodeRef's (needs to be a sub-node of that)tree
: recursive_toggle
(recursive
for default), unselectable
and tree_settings
(see tree above)dropdown
or select
: depth
(int) how many levels to load, sort
('asc', 'desc', or function) to sort the values, indent
(String) how to indent the levels inside the dropdown (default is ' ')range
for "from-to" searchesplaceholder
to set a placeholder textplaceholder
to set a placeholder text, datalist
(boolean) to suppress facet auto-completewhen configuring a bunch of infofields, make use of
$.extend
to not repeat identical setting
var info_template = {name: 'infofield', autosubmit: true, collapsible: false, style: 'select'};
var search = $('#anura-search').anuraSearch({
/*...*/,
widgets: [
{name: 'text'},
$.extend({}, info_template, {id: 102}), // brand
$.extend({}, info_template, {id: 116, root_node: 10909}), // product
$.extend({}, info_template, {id: 114}), // model year
$.extend({}, info_template, {id: 128}), // perspective
$.extend({}, info_template, {id: 108, style: 'radio'}), // copyright
]
}
{name: 'submit', show: true, resettable: false}
false
when using autosubmit
)type: String, required: no, default: ''
Prefix for the state fragment in the URL (only needed for multi-instance). Set to false
to completely disable state (deep linking through updating the URL fragment)
type: String, required: no, default: ''
Add additional search restrictions (using the API syntax) that are not visible to the user, e.g. search_node=123
type: String, required: no, default: ''
An additional class to add to each widget container (may be overridden by the widget's settings)
type: String, required: no, default: ''
An additional class to add to buttons, e.g. btn btn-default
when using bootstrap
type: boolean, required: no, default: true
Triggers an "empty" search when anuraSearch is done loading to show "all" assets in the attached main view (in which case )
type: String, required: no, default: null
What to search for when no search was entered by the user (initially or after reset) - leave blank to search for everything
Type: boolean, required: no, default: false
Request faceted response when searching (needs anuraSolr to be set up). This hides irrelevant values from all search filters
Type: boolean, required: no, default: true
When using facets
, also display now many results each value would provide if it were selected
infofield-id
(options) - triggered after an informationfield widget is done loading (independent of anura-init)<div class="anura-search-container anura-locale-en">
<input type="text" class="anura-search-text">
<fieldset class="anura-search-type">
<legend>Type</legend>
<input type="checkbox"><label>Images</label><br>
<input type="checkbox"><label><!--etc--></label>
</fieldset>
<fieldset class="anura-search-keywords">
<legend>Keywords</legend>
<div class="anura-search-keyword-tree">
<!-- anura-tree-container -->
</div>
</fieldset>
<fieldset class="anura-search-infofield">
<legend>Usage rights</legend>
<input type="radio"><label>freely available</label><br>
<input type="radio"><!--etc--></label>
</fieldset>
<input type="button" value="Search" class="anura-search-button">
<a class="anura-search-reset">Clear</a>
</div>
Provides breadcrumbs based on an anuraTree's selection (e.g. [Earth > Europe > Switzerland])
Name | Example | Default | Comment |
---|---|---|---|
tree | myTree |
null | the anuraTree to listen on (from the $.anuraTree call) |
multiMode | 'global' |
'local' | when to switch to multi-mode (tags instead of hierarchy), one of: "local" (per tree), "global" (over all trees) or "always" |
callback | function(server, kind, id, name) {...} |
null | called when a node/leaf is clicked |
Classic:
<ul class="anura-breadcrumbs-container">
<li class="anura-breadcrumb anura-breadcrumb-levels anura-breadcrumb-level-0"><a data-id="3">World</a></li>
<li class="anura-breadcrumb anura-breadcrumb-levels anura-breadcrumb-level-1"><a data-id="32">Europe</a></li>
<li class="anura-breadcrumb anura-breadcrumb-levels anura-breadcrumb-level-2"><a data-id="42">Switzerland</a></li>
</ul>
Multi-Mode:
<ul class="anura-breadcrumbs-container">
<li class="anura-breadcrumb anura-breadcrumb-multi"><a data-id="42">Switzerland</a></li>
<li class="anura-breadcrumb anura-breadcrumb-multi"><a data-id="1337">Cheese</a></li>
<li class="anura-breadcrumb anura-breadcrumb-multi"><a data-id="4123">AOC</a></li>
</ul>