Thanks for comment!
Article is good, but it covers just routers basics. My problem is more complex:
Assume I have some backend main page (like example.com/admin).
Page is consisting of:
- Top navbar that holds project name and info about currently logged user (with some submenu on hover - like logout) and some search box
- first thin sidebar on the left with icons for modules (dashboard, users, files…)
- then there is “content” but that content can be:
- just content
- content with one more sidebar
Use case
Lets say user is on Dashboard. The setup will be as following:
- navbar and thin sidebar with modules (just the same all the time)
- rest is content with some stats, logs etc…
User navigates to users modules (example.com/admin/users - this is not ember route):
- navbar and thin sidebar with modules (just the same all the time)
- content is made of two parts:
- sidebar with list of users
- rest of content is filled with user info
what can change here? what I need to be able to navigate and show? eg:
- by clicking on different user in the sidebar change the rest of content and display proper info
- by clicking on edit to show editing form
- switch sidebar with list of users to list of groups
- and some shared stuff - display notification when user is saved (notifications should be made globaly)
How I thought I should solve it?
having following html:
<body>
<div class="notifications"></div>
<div class="navbar">project, user info</div>
<aside class="modules">list of avalible modules</aside>
<div class="page">
...<aside class="sidebar">optional. sometimes will be shown, sometimes not (list of users, groups, folders...</aside>
...<div class="content">user detail, list of files...</div>
</div>
</body>
- notifications driven by view
- navbar driven by controller? but I cant have a controller outside app root element. can’nt I? So driven by app
- Page managed by App with templates on content and a view on sidebar?
Second thought was on making whole body an app and then have {{outlet ‘sidebar’}}, {{outlet 'content}}, notifications outlet(?) and so on…
I did some little Ember app but on this I guess I would need someone to chat with a bit to dsscuss it :- ( how to structure some bigger app. For simple apps it is quite straightforward, but for this…
many many thanks!
I will give anything to someone that will help me with those “basics”…