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_home_page_promoted_collections()

Description

Retrieve promoted collections to be displayed on the home page.

This function fetches public collections that are marked for publishing to the home page.
It returns an array of collection data, including metadata and thumbnail information for the
home page image if one is assigned.

- 'ref' (int): The unique identifier for the collection.
- 'type' (int): The type identifier for the collection.
- 'name' (string): The name of the collection.
- 'home_page_publish' (int): Indicates if the collection is published on the home page.
- 'home_page_text' (string): Display text for the collection for the home page.
- 'home_page_image' (int): Resource ID for the image displayed on the home page.
- 'thumb_height' (int): Thumbnail height of the associated image.
- 'thumb_width' (int): Thumbnail width of the associated image.
- 'resource_type' (int): The type of the associated resource.
- 'file_extension' (string): File extension of the associated resource.

Parameters

This function accepts no parameters.

Return

array An array of associative arrays representing each promoted collection, with keys:

Location

include/collections_functions.php lines 3815 to 3820

Definition

 
function get_home_page_promoted_collections()
    {
    global 
$COLLECTION_PUBLIC_TYPES;
    
$public_types join(", "$COLLECTION_PUBLIC_TYPES); // Note this is a constant and not user input - does not need to be a a parameter in the next line.
    
return ps_query("select collection.ref, collection.`type`,collection.name,collection.home_page_publish,collection.home_page_text,collection.home_page_image,resource.thumb_height,resource.thumb_width, resource.resource_type, resource.file_extension from collection left outer join resource on collection.home_page_image=resource.ref where collection.`type` IN ({$public_types}) and collection.home_page_publish=1 order by collection.ref desc");
    }

This article was last updated 12th December 2024 14:35 Europe/London time based on the source file dated 12th December 2024 10:55 Europe/London time.