Skip to main content

GV\Entry_Template

The Entry Template class .

Renders a \GV\Entry using a \GV\Entry_Renderer.

Source: future/includes/class-gv-template-entry.php:23

Details

  • Kind: class
  • Namespace: GV
  • Extends: Template

Properties

PropertyTypeDescription
$filter_prefixstringPrefix for filter names.
$theme_template_directorystringDirectory name where custom templates for this plugin should be found in the theme.
$plugin_template_directorystringDirectory name where the default templates for this plugin are found.
$entry\GV\EntryThe entry that need to be rendered.
$view\GV\ViewThe view context.
$request\GV\RequestThe request context.
$slugstringThe template slug to be loaded (like "table", "list")

Methods

MethodDescription
__construct()Initializer.
add_id_specific_templates()Enable granular template overrides based on current post, view, form, etc.
render()Output some HTML.
get_back_label()Fetch the back link label for an entry context.

Method Reference

__construct()

public function __construct( Entry $entry, View $view, Request $request )

Initializer.

Parameters

NameTypeDefaultDescription
$entryEntry
$view\GV\ViewThe View connected to this template.
$request\GV\RequestThe request context.
$entries\GV\Entry_CollectionA collection of entries for this view.

Source: future/includes/class-gv-template-entry.php:72

add_id_specific_templates()

public function add_id_specific_templates( $templates, $slug, $name )

Enable granular template overrides based on current post, view, form, etc.

The loading order is:

  • post-[ID of post or page where view is embedded]-view-[View ID]-entry-[Entry ID]-table-footer.php
  • post-[ID of post or page where view is embedded]-entry-[Entry ID]-table-footer.php
  • post-[ID of post or page where view is embedded]-view-[View ID]-table-footer.php
  • post-[ID of post or page where view is embedded]-table-footer.php
  • view-[View ID]-entry-[Entry ID]-table-footer.php
  • form-[Form ID]-entry-[Entry ID]-table-footer.php
  • view-[View ID]-table-footer.php
  • form-[Form ID]-table-footer.php
  • entry-[Entry ID]-table-footer.php
  • table-footer.php

Parameters

NameTypeDefaultDescription
$templatesarrayExisting list of templates.
$slugstringName of the template base, example: table, list, datatables, map
$namestringName of the template part, example: body, footer, head, single

Returns

  • array — $templates Modified template array, merged with existing $templates values

See Also

  • \Gamajo_Template_Loader::get_template_file_names() Where the filter is

Source: future/includes/class-gv-template-entry.php:110

render()

public function render()

Output some HTML.

Returns

  • void

Source: future/includes/class-gv-template-entry.php:140

get_back_label()

public function get_back_label( $do_replace=true )

Fetch the back link label for an entry context.

Parameters

NameTypeDefaultDescription
$do_replacebooleantrueWhether to perform merge tag replacements, etc.

Returns

  • string — The link label

See Also

  • \gravityview/template/links/back/label` filter`

Source: future/includes/class-gv-template-entry.php:167