Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add Sitelet embedding combinator #307
Add a combinator to embed a Sitelet in another, more general type, for example if we have:
type EmbeddedAction = | // ... type RootAction = | // ... | Embed of EmbeddedAction
then we want a combinator that allows to easily create a
This would be great. I did something similar here:
This is what I currently have in mind: https://gist.github.com/Tarmil/42d211300e09fde95b3b (example use and implementation)
added a commit
Dec 9, 2014
I'm not sure this is sufficient because you can't, for example, link back to the homepage from the embedded site.
i.e. You can't do this: inside Action1:
It would also be nice to use the parent templates in the child.
I found my original request for this feature (and your comments) here: http://fpish.net/topic/Some/0/76197
I think there is a use case for both:
module NestedSite = let content templateWrapper = function | Foo -> templateWrapper <| fun ctx -> [ Div [Text "Foo page"] ] | Bar x -> templateWrapper <| fun ctx -> [ Div [Text "Bar page"] ] | Upload -> UploadHandler.UploadContentFactory "file" (fun _ -> "/success") (fun file -> () (*Save to disk etc here...*)) let Main = Sitelet.Sum [ Sitelet.Content "/" Home HomePage Sitelet.Content "/About" About AboutPage Sitelet.InferPartialInUnion <@ Nested @> (NestedSite.content (Skin.WithTemplate "Home")) ]