<<

NAME

ProductOpener::KnowledgePanelsContribution - Generate knowledge panels around contribution

SYNOPSIS

This is a subpart of Knowledge Panels where we concentrate around contribution information

create_tag_knowledge_panels ($tag_ref, $target_lc, $target_cc, $options_ref, $tagtype, $canon_tagid)

Create all knowledge panels for a tag, with strings (descriptions, recommendations etc.) in a specific language, and return them in an array of panels.

Arguments

tag reference $tag_ref

Hash structure for the tag. Can be empty. Will be used to return the panels.

language code $target_lc (or "data")

Returned panels contain both data and strings intended to be displayed to users. This parameter sets the desired language for the user facing strings.

If $target_lc is equal to "data", no strings are returned.

country code $target_cc

Needed for some country specific panels like the Eco-Score.

options $options_ref

Defines how some panels should be created (or not created)

- deactivate_[panel_id] : do not create a default panel -- currently unimplemented - activate_[panel_id] : create an on demand panel -- currently only for physical_activities panel

tag type $tagtype

canonical tagid $canon_tagid

Return values

Panels are returned in the "knowledge_panels_[$target_lc]" hash of the tag reference passed as input.

create_category_packagings_materials_panel ($tag_ref, $target_lc, $target_cc, $options_ref, $category_idf)

Creates a knowledge panel to show the packagings materials stats of a category

Arguments

category id $category_id

Canonical category id.

tag reference $tag_ref

Data about the tag, will store the knowledge panel.

language code $target_lc

Returned attributes contain both data and strings intended to be displayed to users. This parameter sets the desired language for the user facing strings.

country code $target_cc

<<