Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Pages
Mattia Roccoberton edited this page May 2, 2023
·
1 revision
A page is presented using a View object.
Sample:
sections:
- slug: statsname: Statstype: pagepage: StatsPageThen define your view object page:
classStats < TinyAdmin::Views::DefaultLayoutdeftemplatesuperdoh1{'Stats page'}endenddeftitle'A stats page'endendA Content object is a like a Page but its content is defined directly in the configuration itself.
Sample:
sections:
- slug: test-contentname: Test contenttype: contentcontent: > <h1>Test content!</h1> <p>Some test content</p>You can customise also the page for missing pages (PageNotFound) and the page for missing records (RecordNotFound) using your own View objects.
Sample:
page_not_found: PageNotFoundrecord_not_found: RecordNotFoundAnd then:
classPageNotFound < TinyAdmin::Views::DefaultLayoutdeftemplatesuperdoh1{'Page not found!'}endendendclassRecordNotFound < TinyAdmin::Views::DefaultLayoutdeftemplatesuperdoh1{'Record not found!'}endendend