Documentation

render_functions.php

Table of Contents

Functions

render_individual_menu()  : void
render_content_menu()  : void
render_new_content_button()  : void
Render the new content button
render_new_block_element_button()  : void
Render the button for new content item within a group.
render_block_colour_item()  : void
Render a colour page content item. Example: ```php render_block_colour_item([ 'ref' => 9, 'name' => 'Black', 'hex' => '000000', 'rgb' => '0, 0, 0', 'cmyk' => '0, 0, 0, 100', ]); ```
render_navigation_item()  : void
Render the table of contents (TOC) items.
render_item_top_right_menu()  : void
Render the contextual right menu.
render_resource_item()  : void
Render resource content item.
render_video_player()  : string
Render video player for resource content items

Functions

render_new_content_button()

Render the new content button

render_new_content_button(string $id, array{class: list$ctx) : void
Parameters
$id : string

The HTML id of the button

$ctx : array{class: list}

render_new_block_element_button()

Render the button for new content item within a group.

render_new_block_element_button(string $class, BRAND_GUIDELINES_CONTENT_TYPES> $type) : void
Parameters
$class : string

CSS class to use

$type : BRAND_GUIDELINES_CONTENT_TYPES>

Content item type to create

render_block_colour_item()

Render a colour page content item. Example: ```php render_block_colour_item([ 'ref' => 9, 'name' => 'Black', 'hex' => '000000', 'rgb' => '0, 0, 0', 'cmyk' => '0, 0, 0, 100', ]); ```

render_block_colour_item(array{ref: int, name: string, hex: string, rgb: string, cmyk: string} $value, array{top_right_menu_class: list$ctx) : void
Parameters
$value : array{ref: int, name: string, hex: string, rgb: string, cmyk: string}

Colour value to render

$ctx : array{top_right_menu_class: list}

render_navigation_item()

Render the table of contents (TOC) items.

render_navigation_item(array<string|int, mixed> $item[, bool $is_current = false ][, array{class: list, top_right_menu_class: list$ctx = [] ]) : void
Parameters
$item : array<string|int, mixed>

A section/page record get_all_pages()

$is_current : bool = false

Specify if the input item is the currently selected page

$ctx : array{class: list, top_right_menu_class: list} = []

render_item_top_right_menu()

Render the contextual right menu.

render_item_top_right_menu(int $ref[, array<int, string> $class = [] ]) : void
Parameters
$ref : int

Items' ID. Note: item is generic here, it refers to both section/page as well as page content items.

$class : array<int, string> = []

List of HTML classes to add to the wrapping div.

render_resource_item()

Render resource content item.

render_resource_item(array<string|int, mixed> $item, array{top_right_menu_class: list$ctx) : void
Parameters
$item : array<string|int, mixed>

A decoded page content item. guidelines.php

$ctx : array{top_right_menu_class: list}

render_video_player()

Render video player for resource content items

render_video_player(array<string|int, mixed> $resource[, array{context: string, max_width: int, max_height: int} $ctx = [] ]) : string
Parameters
$resource : array<string|int, mixed>

Resource data get_resource_data()

$ctx : array{context: string, max_width: int, max_height: int} = []

Set optional context for the rendered video player

Return values
string

Either nothing or the video player HTML to render

On this page

Search results