# Gossamer Links Help

Table of Contents

Developers Guide: Plugin Hooks This section describes all the hooks available in Gossamer Links. Searching Adding Modifying Templates ...

Searching

Name: | search_results
PRE Input: | none
POST Input: | HASH REF: On success: tags required for search_results.html template. On failure: tags required for search_failure.html template.
Triggered On: | search.cgi being run with query=something being passed in.
Description: | This hook is run whenever a search is run, and it generates a list of search results that will be sent to the success or failure templates depending on whether error => 'message' is a key in the hash that is returned.

Top

Name: | site_html_search_results
PRE Input: | HASH REF: link_results => html formatted list of matching links, category_results => html formatted list of matching links, link_hits => total number of links matched cat_hits => total number of categories matched next => a formatted html toolbar or empty if not that many results term => a url escaped version of what the user searched for
POST Input: | SCALAR: Fully formatted HTML page.
Triggered On: | search.cgi being run with some results being found.
Description: | This hook generates a fully formatted html page.

Top

Name: | site_html_search_failure
PRE Input: | HASH REF: error => formatted error message string of why no results were found term => a url escaped version of what the user searched for
POST Input: | SCALAR: Fully formatted HTML page.
Triggered On: | search.cgi being run with no results being found.
Description: | This hook generates a fully formatted html page.

Top

Adding Links

Name: | add_link
PRE Input: | none
POST Input: | HASH REF: On success: tags required for add_success.html template. On failure: tags required for add_failure.html template.
Triggered On: | add.cgi being run with add=something being passed in.
Description: | This hook is run whenever the add_form is submitted, and it adds a link to the Links table, and emails the administrator that a link is awaiting validation.

Top

Name: | site_html_add_success
PRE Input: | HASH REF: A complete hash ref of the new link that was added which includes all columns defined in the Links table, plus: Category => a newline separted string of Category Names that this link was added too.
POST Input: | SCALAR: Fully formatted HTML page.
Triggered On: | add.cgi being run and the link being successfully added.
Description: | This hook generates a fully formatted html page.

Top

Name: | site_html_add_failure
PRE Input: | HASH REF: error => formatted error message string of why link could not be added Category => a select list/hidden field for use in category form.
POST Input: | SCALAR: Fully formatted HTML page showing search results.
Triggered On: | add.cgi being run, with errors in the submission.
Description: | This hook generates a fully formatted html page.

Top

Modifying Links

Name: | modify_link
PRE Input: | none
POST Input: | HASH REF: On success: tags required for modify_success.html template. On failure: tags required for modify_failure.html template.
Triggered On: | modify.cgi being run with modify=something being passed in.
Description: | This hook is run whenever the modify_form is submitted, and it either changes a link in the Links table, or records the change awaiting validation.

Top

Name: | site_html_modify_success
PRE Input: | HASH REF: A complete hash ref of the new link that was changed which includes all columns defined in the Links table, plus: Category => a newline separted string of Category Names that this link was placed in.
POST Input: | SCALAR: Fully formatted HTML page.
Triggered On: | modify.cgi being run and the link being successfully changed.
Description: | This hook generates a fully formatted html page.

Top

Name: | site_html_modify_failure
PRE Input: | HASH REF: error => formatted error message string of why link could not be added Category => a select list/hidden field for use in category form.
POST Input: | SCALAR: Fully formatted HTML page showing search results.
Triggered On: | modify.cgi being run, with errors in the submission.
Description: | This hook generates a fully formatted html page.

Top

Templates:

Name: | site_html_[template name]
PRE Input: | HASH REF of template tags available.
POST Input: | SCALAR: Fully formatted HTML page showing parsed template.
Triggered On: | Any time output is displayed to the user, it's through a template.
Description: | Any template can be overriden by using the hook site_html_template_name. So if you want to override the displaying of a link, you would do site_html_link.

Table of Contents