You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding an alias named contents to the html property of the shell-empty component (#1122)
* Adding an alias named contents to the html property of the shell-empty component
* Changes for the shell-empty documentation
* improve shell comoonent description
* shell-empty docs clarification
---------
Co-authored-by: Olivier Auverlot <[email protected]>
Co-authored-by: lovasoa <[email protected]>
('favicon', 'The URL of the icon the web browser should display in bookmarks and tabs. This property is particularly useful if multiple sites are hosted on the same domain with different [``site_prefix``](https://github.com/sqlpage/SQLPage/blob/main/configuration.md#configuring-sqlpage).', 'URL', TRUE, TRUE),
@@ -1521,16 +1534,41 @@ SELECT
1521
1534
```
1522
1535
', NULL),
1523
1536
('shell', '
1524
-
### A page without a shell
1525
-
SQLPage provides the `shell-empty` component to create a page without a shell.
1526
-
In this case, the `html` and `body` tags are not generated, and the components are rendered directly in the page
1527
-
without any styling, navigation bar, footer, or dynamic content.
1528
-
This is useful when you want to generate a snippet of HTML that can be dynamically included in a larger page.
1537
+
### Returning custom HTML, XML, plain text, or other formats
1538
+
1539
+
Use `shell-empty` to opt out of SQLPage''s component system and return raw data directly.
1540
+
1541
+
By default, SQLPage wraps all your content in a complete HTML page with navigation and styling.
1542
+
The `shell-empty` component tells SQLPage to skip this HTML wrapper and return only the raw content you specify.
1529
1543
1530
-
Any component whose name starts with `shell` will be considered as a shell component,
1531
-
so you can also [create your own shell component](custom_components.sql#custom-shell).
1544
+
Use it to create endpoints that return things like
1545
+
- XML (for JSON, use the [json](?component=json) component)
1546
+
- plain text or markdown content (for instance for consumption by LLMs)
1547
+
- a custom data format you need
1532
1548
1549
+
When using `shell-empty`, you should use the [http_header](component.sql?component=http%5Fheader) component first
1550
+
to set the correct [content type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type) (like `application/json` or `application/xml`).
0 commit comments