November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Standard page elements like headers and footers are not usually handled as blocks they are handled as part of the core MVC templates.
E.g a page would be made up of elements
-------------------------------------------
header (Part of the core page template)
-------------------------------------------
body (Containing blocks)
-------------------------------------------
footer (Part of the core page template)
So for example in the Alloy demo scenario the header and footer are just rendered in the core page template. The data/viewmodel would be built up by core data in the CMS depending on what you want to achieve. For example a header with a top navigation would usually be driven by sub pages of the home page that are set as show in navigation and rendered in the view. Usually a common approach for header configuration is adding properties to the home page for the header and footer or separating this configuration out.
You can put block in the header and footer as well but these are more commonly used more for CTAs, Logos and small content pieces rather than core configuration. This is because core site configuration should be stored globally and then rendered on page templates. This also allows this data to be cached until change using episerver syncronizing caching system so you can build a view model for core site data that will drive core page information such as the header and footer used across all pages.
And Alloy is pretty much the simplest example of a content driven Episerver website you'll find as a reference.
I have played with alloy, and gone through the "geting started" docs, but there are a lot of gaps.
The first thing one might want to do with an empty site is to create a block (via the conent editing tools) which will be the header for every page. I would expect this to be a simple HTML block with some links and a logo, all editable. Looking at alloy, the header is hard coded into the template. It is not a block or editable.
So I get that episerver doesnt want the content editors to be able to modify the "templates", only very limited areas on pages. this is fine if the company has a lot of c# developers.
What is the best way to create an editable header and footer block, which appears on many different page templates, but is still editable (i.e. to add new page links)?
I think that episerver, unlike say dreamweaver, doesnt allow nested templates. Ie. you cant create a template with an editable header and footer, then base inner templates off this, where inner templates can put conent in areas where the parent temlates designate. I understand this kind of thing is done with blocks. but I dont see any shared blocks. Why is header not just a block, which is hard coded to be included on all page templates?
I see there is something called Header.cshtml in shared. It gets the page links from "item". Where does item come from? It is not in the pages model, nor in the "SitePageData" which it inherits from?
where does this header shared view get inculded in the templates which use it? Its not in the pages view. I cant see a controler per template, or a link between the page and its controller. There seems to be no controller for "StandardPage", althoug it does have a view and a model. I understood that view, model and conroller were linked by naming convention, but this does not seem to be the case here.
Does anyone have an example of a better (more logical, easy to edit etc) way to do headers and footers? Alloy seems overly complex with little flexibility. Anyone have a good skeleton site?