-
Notifications
You must be signed in to change notification settings - Fork 10
Page
Mladen Janjetovic edited this page May 1, 2017
·
9 revisions
You could access our package Page instance with SLA::page().
SLA::page(); //this will return you appropriate Query Builder
SLA::page($page); //this will return the Page Model, where `$page` can be page ID or page slug.SLA::page()->menu(); //generate nested menu from `Pages`This will generate your HTML. You can style your menu like this:
.nav-list{
li > ul{
padding-left: 20px;
padding-right: 20px;
}
}
SLA::page()->tree(); //generates menu array from `Pages`SLA::page($page)->elements(); //returns you all page elements as relationship `hasMany`.
SLA::element($element_key); //returns PageElement Model
echo SLA::element($element_key); //returns content of the element, like SLA::element($element_key)->contentSEO meta implementation. getMeta() returns array of meta keys and it can be sent directly to blade template. Use $title, $description and $keywords variables in your blade layouts.
return view('about', SLA::page('about')->getMeta());