Closed amiller-gh closed 4 years ago
Experimental pages side menu, site navigation config, and "create new page" button visuals:
Global site navigation can be referenced in-template like:
<nav class="nav" id="sidebar">
<ul class="nav__links">
{{#collection @navigation as |page|}}
<li>
<a href="{{page.permalink}}" class="{{if page.isActive "active"}}">
{{page.title}}
</a>
</li>
{{/collection}}
</ul>
</nav>
Merging into master to open a PR in the main repo – this is in a decent draft state :)
Began implementing https://github.com/vapid/vapid/issues/158 here so we can play with it and get a feel for the new data model features 🙂
Data Model Updates
sections
table totemplates
type
column in thetemplates
table of type ENUM(setting, form, page, collection).multiple=1
templates to typecollection
form=1
templates to typeform
setting
form
andmultiple
columns fromtemplates
records.section_id
column torecords.template_id
type=page
template entries for each discovered/[^_]*.html
file.record
instance for each template entryTemplate Parser Updates
this.
inside ofpage
templates and add them to the page's template entry as fields.general.
as the path context to avoidthis.
conflicts._
pseudo-private prefix and log a deprecation warning. Automatically rewrite_
paths to@
for proper Handlebars data attribute rendering support.{{#collection name as |value|}}
block helper to the runtime and analyzer.{{#section name multiple=true}}
helper to analyze atype=collection
{{#section name multiple=true}}
Rewrite the{{#section name multiple=true}}
to{{#collection name as |value|}}
(this is hard and requires children path rewrites... may not be reasonably possible.)Dashboard Updates
Page
s in the admin dashboard as single records.Page
s, selecting from the projectPage
templates as data structure options.Page
s (including the default created ones)Collection
instances, selecting from the available templates.Collection
instances – including the defaultCollection
created.collection
directive for the dashboard – users may select from a list of collections that use the same template.Came up with an idea as I was working here: What if we allow
{{#collection this.name as |value|}}
(note:this.name
instead ofname
). This would make a page-specific collection. It won't be shared between other pages and will show up as a direct child of the page in the dashboard. Essentially, each page instance will get a private collection to reference.Also: