Skip to content

Commit 652472e

Browse files
committed
docs: update customization documentation to reflect changes from customLayout to sidebarAndHeader for layout control
1 parent 0f4bc9a commit 652472e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adminforth/documentation/docs/tutorial/03-Customization/06-customPages.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,13 +472,13 @@ Add to your `<script setup>` section:
472472
import { Link } from '@/afcl';
473473
```
474474
475-
If you set `customLayout: true` in the `meta` object, it will not include default layout like sidebar and header, so you can create your own layout for this page.
475+
If you set `sidebarAndHeader: 'none'` in the `meta` object, it will not include default layout like sidebar and header, so you can create your own layout for this page.
476476
477477
### Disable redirects to login page (Public pages)
478478
479479
Any route which has sidebar and header (e.g. default CRUD pages or menu item with `component`) uses internal AdminForth REST API to fetch menu items and user information, so it passes authentication check and if authentication cookie is not provided or has expired JWT user gets redirected to the login page.
480480
481-
In case if you set `customLayout: true`, it will not call these APIs so user will not be automatically redirected to the login page in case of expired or not-provided authentication cookie. That feature allows you to implement public pages without authentication, e.g. Terms of Service, Privacy Policy and many others. In case if you need to check if user is logged in just call any custom API which has `admin.express.authorize` middleware. Obviously for public pages if they use any APIs you should create API endpoint WITHOUT `admin.express.authorize` middleware.
481+
In case if you set `sidebarAndHeader: 'none'`, it will not call these APIs so user will not be automatically redirected to the login page in case of expired or not-provided authentication cookie. That feature allows you to implement public pages without authentication, e.g. Terms of Service, Privacy Policy and many others. In case if you need to check if user is logged in just call any custom API which has `admin.express.authorize` middleware. Obviously for public pages if they use any APIs you should create API endpoint WITHOUT `admin.express.authorize` middleware.
482482
483483
> Please note that AdminForth uses classic SPA Vue app, so even public pages will be rendered by JavaScript in the browser and not on the server side. If your public page should be indexed by search engines, you should use some SSR framework like Nuxt.js to create such pages. At the same time public pages can still be usefull if you don't focus on old-fashioned search engines (modern search engines can index SPA pages as well) or if indexing is not important for such pages at all (e.g. Terms of Service, Privacy Policy, Contact Us and many others).
484484
@@ -497,7 +497,7 @@ You can add custom meta attributes to the page by passing `meta` object to the p
497497
file: '@@/pages/TwoFactorsSetup.vue',
498498
meta: {
499499
title: 'Setup 2FA', // meta title for this page
500-
customLayout: true, // don't include default layout like menu/header
500+
sidebarAndHeader: 'none', // don't include default layout like menu/header
501501
//diff-add
502502
myAttribute: 'a1'
503503
}

0 commit comments

Comments
 (0)