[web-devel] [Yesod] Nesting widgets

Mark Bradley barkmadley at gmail.com
Mon Jun 6 07:41:09 CEST 2011


Hi Aren,

You should try including the widget using the ^{} syntax instead of
the ${} syntax.

See here for an example:
http://www.yesodweb.com/show/map/1/183

widget <- do
  addHamlet [hamlet| some html |]
  addCassius [cassius| some css |]
otherwidget <- do
  addHamlet [hamlet|
 <div
    ^{widget}
]

On Mon, Jun 6, 2011 at 2:05 PM, Aren Olson <reacocard at gmail.com> wrote:
> In Yesod, if I have two Widgets, how can I 'nest' the content of one
> widget inside one of the tags of the other? In effect, I want to be
> able to do something like
>
> widget <- do
>  addHamlet [hamlet| some html |]
>  addCassius [cassius| some css |]
> otherwidget <- do
>  addHamlet [hamlet|
> <div
>    ${widget}
> ]
>
> and end up with the body contents from widget inside otherwidget's
> <div> tag, while widget's cassius data still ends up in the page's
> <head> as normal.
>
> I can't find any documentation or examples of this, and nothing I
> tried would compile. Is this doable? If so, how?
>
> Thanks,
> -Aren
>
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel
>



-- 
-barkmadley
sent from an internet enabled device



More information about the web-devel mailing list