Jump to content

Template:Person bio box

From HopperWiki

Purpose

The Person bio box template is designed to display a biography box on a HopperWiki page. The box features a person's photo, name, title, and a brief biography. It uses data stored in a Cargo table named "Person" to fetch these details based on the person's full name.

Usage

Used to display concise biographical information for a focal person.

Syntax

{{Person bio box|name=|position_title=}}

  • `name` (optional): Specifies the full name of the person to retrieve data for. If omitted, the template uses the title of the current page as the value to search for.
  • `position_title` (optional): Specifies the position title(s) to be displayed with that person's bio. If omitted, the template fetches the title from the Cargo table.

Handling errors

The template is designed to handle situations where the specified name does not exist in the Cargo database. In such cases, it displays an error message in red text indicating that the name could not be found. This error handling ensures that the user is aware of missing or incorrect data entries.

Developer notes

  • Cargo integration: The function uses Cargo to query a database table named "Person". Make sure that this table exists and is properly populated with the fields Full_name, Image, Position_titles, and Bio.
  • Dynamic data handling: If the name parameter is not provided in the template arguments, the function defaults to using the page title as the name. This behavior can be modified based on specific template needs.
  • HTML structure: The HTML output is structured into several divisions for styling purposes. CSS classes like person-photo-box, person-photo-header, content-wrapper, person-photo-content, and person-photo-text are used. Ensure these classes are defined in the site's CSS for appropriate styling.
  • Error handling: The error handling is basic and could be extended to provide more detailed diagnostic messages or alternative content if needed.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.