This trait provides functionality for loading and displaying article details, as well as handling view loading with additional data preparation.

Methods

detail

Loads and displays the details of an article.

pretty_url
string

The pretty URL of the article to display

print
boolean
default: false

Whether to render the page for printing

return
boolean
default: false

If true, returns the rendered view as a string instead of outputting it

This method performs the following tasks:

  1. Retrieves general data such as language and login status
  2. Fetches the article by its pretty URL
  3. Checks language compatibility and redirects if necessary
  4. Retrieves related articles
  5. Prepares SEO data
  6. Loads module data
  7. Renders the detail view or returns it as a string

load_view

Loads and renders a view with additional data preparation.

view
string

The name of the view to load

viewdata
array

An array of data to pass to the view

This method:

  1. Prepares OpenAI-related data
  2. Sets up SEO and Open Graph data
  3. Handles cookie warnings
  4. Prepares menu items and translations
  5. Loads and renders the specified view along with header and footer

getOpenaiData

Prepares OpenAI-related data for use in views.

data
array

The existing data array to augment with OpenAI data

return
array

The augmented data array containing OpenAI-related information

This method:

  1. Retrieves page settings for conditional OpenAI display
  2. Fetches available languages and language lines
  3. Retrieves and processes OpenAI prompts
  4. Determines the preselected language
  5. Gets the last chat ID