[web-devel] [Yesod] Nesting widgets

Michael Snoyman michael at snoyman.com
Mon Jun 6 19:37:13 CEST 2011


Sorry for a terse reply, but the trick is to replace addHamlet with
addWidget, and the original code should work. Let me know if you're
still having trouble, I should have more time to respond next week.

On Mon, Jun 6, 2011 at 8:34 PM, Aren Olson <reacocard at gmail.com> wrote:
> On Mon, Jun 6, 2011 at 12:22, Aren Olson <reacocard at gmail.com> wrote:
>> On Mon, Jun 6, 2011 at 00:41, Mark Bradley <barkmadley at gmail.com> wrote:
>>> You should try including the widget using the ^{} syntax instead of
>>> the ${} syntax.
>>
>> Doesn't appear to work. I tried this:
>>
>> <snip>
>
> Apparently I fail at using Haskell right; obviously contents <-
> addHamlet won't give me a Widget. :)  This code works:
>
> blockW :: Widget ()
> blockW = do
>    let contents = addHamlet [hamlet|example|]
>    body <- extractBody contents
>    addHamlet [hamlet|
> <div
>    ^{body}|]
>
>
> Thanks for the help Mark!
>
> -Aren
>
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel
>



More information about the web-devel mailing list