-
Notifications
You must be signed in to change notification settings - Fork 44
Available Functions for templates
The $interface
object for templates provides several functions, which can be used within the get_entry()
method in templates. These functions are described in the following:
Returns the authors of a publication
before (optional)
(string) HTML part before the authors.
after (optional)
(string) HTML part after the authors.
$s .= $interface->get_author('<p class="tp_pub_author">', '</p>');
Returns the data for a publication row
none
$data = $interface->get_data();
Returns the images
position (optional)
(string) right, left or bottom.
$s .= $interface->get_images('bottom');
Returns all info containers (altmetric, bibtex, abstract, links)
none
$s .= $interface->get_infocontainer();
Generates a span element for the selected publication data field
element (optional)
(string) The data field (for example: status, journal, type ).
values (optional)
(array) An array of values of the data field, which should be considered as labels.
$interface->get_label('status', array('forthcoming') );
Returns the meta row
none
$s .= '<p class="tp_pub_additional">' . $interface->get_meta() . '</p>';
Returns the number for a numbered publication list
before (optional)
(string) HTML part before the authors.
after (optional)
(string) HTML part after the authors.
$s .= $interface->get_number('<td class="tp_pub_number">', '.</td>');
Returns the tags (with full HTML markup)
before (optional)
(string) HTML part before the authors.
after (optional)
(string) HTML part after the authors.
$s .= '<p class="tp_pub_tags">' . $interface->get_tag_line() . '</p>';
Returns the title of the publication
none
$s .= '<p class="tp_pub_title">' . $interface->get_title() . '</p>';
Returns the type of a publication (with full HTML markup)
none
$s .= '<p class="tp_pub_title">' . $interface->get_type() . '</p>';
Returns the year of a publication
none
$s .= '<span class="tp_pub_year_simple"> (' . $interface->get_year() . ')</span>: ';
Checks if a publication has a specific tag
tag_name (optional)
(string) The name of the searched tag.
if ( $interface->has_tag("Hello Worlds") ) {
...
}