Skip to content

Available Functions for templates

Michael edited this page Mar 11, 2018 · 2 revisions

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:

get_author()

Returns the authors of a publication

Options

before (optional)

(string) HTML part before the authors.

after (optional)

(string) HTML part after the authors.

Example

$s .= $interface->get_author('<p class="tp_pub_author">', '</p>');

get_data()

Returns the data for a publication row

Options

none

Example

$data = $interface->get_data();

get_images()

Returns the images

Options

position (optional)

(string) right, left or bottom.

Example

$s .= $interface->get_images('bottom');

get_infocontainer()

Returns all info containers (altmetric, bibtex, abstract, links)

Options

none

Example

$s .= $interface->get_infocontainer();

get_label()

Generates a span element for the selected publication data field

Options

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.

Example

$interface->get_label('status', array('forthcoming') );

get_meta()

Returns the meta row

Options

none

Example

$s .= '<p class="tp_pub_additional">' . $interface->get_meta() . '</p>';

get_number()

Returns the number for a numbered publication list

Options

before (optional)

(string) HTML part before the authors.

after (optional)

(string) HTML part after the authors.

Example

$s .= $interface->get_number('<td class="tp_pub_number">', '.</td>');

get_tag_line()

Returns the tags (with full HTML markup)

Options

before (optional)

(string) HTML part before the authors.

after (optional)

(string) HTML part after the authors.

Example

$s .= '<p class="tp_pub_tags">' . $interface->get_tag_line() . '</p>';

get_title()

Returns the title of the publication

Options

none

Example

$s .= '<p class="tp_pub_title">' . $interface->get_title() . '</p>';

get_type()

Returns the type of a publication (with full HTML markup)

Options

none

Example

$s .= '<p class="tp_pub_title">' . $interface->get_type() . '</p>';

get_year()

Returns the year of a publication

Options

none

Example

$s .= '<span class="tp_pub_year_simple"> (' . $interface->get_year() . ')</span>: ';

has_tag() new since 6.2.3

Checks if a publication has a specific tag

Options

tag_name (optional)

(string) The name of the searched tag.

Example

if ( $interface->has_tag("Hello Worlds") ) {
...
}