RTE Fieldtype Extension Hooks
rte_autocomplete_pages($pages, $search, $site_id)
Parameter | Type | Description |
---|---|---|
$pages | Array |
Cached array of site pages |
$search | String |
Search string |
$site_id | Int |
Site ID |
Allows developers to modify (narrow down or widen) the array of pages used for @
-autocomplete in RTE.
$pages
is array with elements in following format:
$pages[] = (object) [
'id' => '@unique-identifier',
'text' => 'main displayed text (e.g. entry title)',
'extra' => 'extra info displayed (e.g. channel name)',
'href' => 'link to the page',
'entry_id' => entry ID,
'uri' => page URI
];
How it’s called:
$pages = ee()->extensions->call('rte_autocomplete_pages', $pages, $search, $site_id);
if (ee()->extensions->end_script === true) {
$break = true;
}
rte_before_display($field, $data)
Parameter | Type | Description |
---|---|---|
$field | Object |
Field instance |
$data | String |
Field data |
Allows modification of field data before the field is being displayed in CP or Channel Form.
How it’s called:
$data = ee()->extensions->call('rte_before_display', $this, $data);
rte_before_save($field, $data)
Parameter | Type | Description |
---|---|---|
$field | Object |
Field instance |
$data | String |
Field data |
Allows modification of field data before it is saved.
How it’s called:
$data = ee()->extensions->call('rte_before_save', $this, $data);
rte_before_replace($field, $data)
Parameter | Type | Description |
---|---|---|
$field | Object |
Field instance |
$data | String |
Field data |
Allows modification of field data before it is being displayed using template tag and before any internal replacements are made (such as parsing the URLs and file upload directories)
How it’s called:
$data = ee()->extensions->call('rte_before_replace', $this, $data);
rte_before_replace_end($field, $data)
Parameter | Type | Description |
---|---|---|
$field | Object |
Field instance |
$data | String |
Field data |
Allows modification of field data before it is being displayed using template tag after internal replacements are made.
How it’s called:
$data = ee()->extensions->call('rte_before_replace_end', $this, $data);