New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Sitelet embedding combinator #307
Comments
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) |
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:
With 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"))
] |
Great stuff :) Thanks. |
Add a combinator to embed a Sitelet in another, more general type, for example if we have:
then we want a combinator that allows to easily create a
Sitelet<RootAction>
given aSitelet<EmbeddedAction>
, which respects the original routing.The text was updated successfully, but these errors were encountered: