Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "half_width_on_mobile" for KP #990

Closed
g123k opened this issue Nov 12, 2024 · 0 comments · Fixed by #992
Closed

Support "half_width_on_mobile" for KP #990

g123k opened this issue Nov 12, 2024 · 0 comments · Fixed by #992
Assignees

Comments

@g123k
Copy link
Contributor

g123k commented Nov 12, 2024

Hi everyone!

The API for knowledge panels now send an attribute half_width_on_mobile for the layout needed by smooth-app:

Image

Eg: https://world.openfoodfacts.org/api/v3/product/737628064502.json?fields=knowledge_panels

"nutrient_level_fat": {
                "elements": [
                    {
                        "element_type": "text",
                        "text_element": {
                            "html": "\n<b>What you need to know</b>\n<ul>\n<li>A high consumption of fat, especially saturated fats, can raise cholesterol, which increases the risk of heart diseases.</li>\n</ul>\n<br>\n<b>Recommendation</b>:\n<b>Limit the consumption of fat and saturated fat</b>\n<ul>\n<li>Choose products with lower fat and saturated fat content.</li>\n</ul>\n",
                            "type": "summary"
                        }
                    },
                    {
                        "element_type": "text",
                        "text_element": {
                            "html": "\n",
                            "source_language": "en",
                            "source_text": "National Health Service UK (NHS) - Fat: the facts",
                            "source_url": "https://www.nhs.uk/live-well/eat-well/food-types/different-fats-nutrition/",
                            "type": "summary"
                        }
                    }
                ],
                "evaluation": "average",
                "half_width_on_mobile": true,
                "level": "info",
                "size": "small",
                "title_element": {
                    "icon_size": "small",
                    "icon_url": "https://static.openfoodfacts.org/images/misc/moderate.svg",
                    "name": "Fat",
                    "title": "Fat in moderate quantity (7.69%)",
                    "type": "percentage",
                    "value": 7.69
                },
                "topics": [
                    "health"
                ]
            }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants