Skip to content

Conversation

@francesco-cattoglio
Copy link
Contributor

By default handlebars handles all falsy values in the same way. This means that there is no way to easily remove the footer from the shell component, because no matter if you leave it empty or give it a false value, the default "Built with SQLPage" one appears.

With this small change, setting the value of the footer parameter to the empty string will completely hide the footer. As an example, this is the configuration from the shell.json in my project:

{
    "component": "shell",
    "footer": "",
    "title": "AA BB CC",
    "javascript": "/scripts/htmx.min.js",
    "link": "/",
    "menu_item": [
        {"link": "p1", "title": "Page 1"},
        {"link": "p2", "title": "Page 2"}
    ]
}

With this patch, if the user specifies the footer for the shell as exactly the empty string, then the whole footer is removed from the page. Leaving the footer as null or undefined still shows the "Build with SQLPage" default footer.
@lovasoa
Copy link
Collaborator

lovasoa commented Feb 28, 2025

Thanks !

@lovasoa lovasoa merged commit 35583a5 into sqlpage:main Feb 28, 2025
10 checks passed
@francesco-cattoglio francesco-cattoglio deleted the optionally_remove_footer branch February 28, 2025 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants