-
Notifications
You must be signed in to change notification settings - Fork 11
Proposals
##Simplified page system (implemented) ###Problem
The page layout system still feels really awkward with the mix of <wpage> and normal elements. It looks rather confusing and complicated. The nesting of <wpage> elements is unnecessary since practically parent pages should never be displayed, and the fact that elements of one page must all go inside a single forces unnecessary use of <wsection> and <wrep> making the HTML really complicated.
###Change
Remove the <wpage> tag altogether, use an attribute to specify pages instead, no more <wpage> nesting, only "concrete pages" are allowed.
To make an element appear in the page, just add w-belong="pageid" to it, for example:
Multiple binds of the same pageid can be used, for example, a layout for the site could be like:
Instead of complicated <wsection>, <wrep> and confusing <wpage>, we can just add the menu of the page to the "menu" div, and the main content to "content" div, like this.
<div class="menu">
<ul w-belong="pg-home">
<li class="active">Home</li>
<li>Profile</li>
</ul>
<ul w-belong="pg-user-profile">
<li>Home</li>
<li class="active">Profile</li>
<li>Bio</li>
<li>Secrets</li>
</ul>
</div>
<div class="content">
<div w-belong="pg-home">
Welcome to Wade.
</div>
<div w-belong="pg-user-profile">
Info blah blah
</div>
</div>
We can use "page groups" for elements that are displayed in more than one page. For example if pg-user-bio and pg-user-secrets both are added to group grp-user-profile, then if we use
<userinfo w-belong="grp-user-profile"></userinfo>
The element would be available in both pg-user-bio and pg-user-secrets.