Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

get_smart_fc_branch_trail()

Description

Helper function for smart featured collections to update $branch_trail with all parent nodes of the selected node

Parameters

ColumnTypeDefaultDescription
$node int Node selected
$tree_node_level int Current level of node in tree
$field_data array Array of the smart featured collections field data
$general_url_params array URL parameters to use with generated href links
$branch_trail array get_all_ancestors_for_node$node Partial array of links to use for renderBreadcrumbs(), only includes the highest level link
$tree_node_level; array; if is_array$all_node_parents

Return

array $branch_trail Full array of parent nodes and field links

Location

include/render_functions.php lines 7960 to 7992

Definition

 
function get_smart_fc_branch_trail(int $nodeint $tree_node_level, array $field_data, array $general_url_params, array $branch_trail) : array
{
    global 
$baseurl_short;

    
$all_node_parents get_all_ancestors_for_node($node$tree_node_level);
    
$opened_nodes = array();
    
    if (
is_array($all_node_parents)) 
        {
        foreach (
$all_node_parents[0] as $p_key => $p_ref
            {
            
$opened_nodes[] = $p_ref;
            }

        foreach (
array_reverse($opened_nodes) as $opened_node
            {
            
$subnodedata = array();
            
get_node($opened_node$subnodedata);
            
$extra_trail = array(
                array(
                    
"title" => i18n_get_translated($subnodedata['name']),
                    
"href"  => generateURL(
                        
"{$baseurl_short}pages/collections_featured.php",
                        
$general_url_params,
                        array(
"smart_rtf" => $field_data['ref'], "smart_fc_parent" => $opened_node)
                    ),
                )
            );
            
$branch_trail array_merge($branch_trail$extra_trail);
            }
        }
    return 
$branch_trail;
}

This article was last updated 24th June 2026 17:35 Europe/London time based on the source file dated 24th June 2026 15:45 Europe/London time.