
Hi all, I'm trying to add to my "admin layout" main menu in Yesod. Normally - doing it in Rails - I would create a partial or helper and then use it in my layout file. But here in Yesod - the concept of widgets seems somewhat fereign to me. I don't quite get them. In my Handler.Admin module I define: adminLayout :: GWidget MyApp MyApp () -> GHandler MyApp MyApp RepHtml adminLayout widget = do mmsg <- getMessage mroute <- getCurrentRoute pc <- widgetToPageContent $ do widget hamletToRepHtml $(hamletFile "admin/admin-layout") then I define my widget ( all in the same file ): mainMenu :: Widget () mainMenu = addWidget $(widgetFile "admin/_menu") And finally in "admin/admin-layout.hamlet" I'm trying to render my menu: ... ^{mainMenu} ... All without a luck.. Compiler yells at me strange ( to me ) things: Handler/Admin.hs:31:27: Couldn't match expected type `GGWidget MyApp (GHandler MyApp MyApp) ()' with actual type `(url0 -> [(T.Text, T.Text)] -> T.Text) -> blaze-html-0.4.1.1:Text.Blaze.Internal.Html' Expected type: Widget () Actual type: hamlet-0.8.1:Text.Hamlet.Quasi.Hamlet url0 In the return type of a call of `pageBody' In the first argument of `hamlet-0.8.1:Text.Hamlet.Quasi.fromHamletValue', namely `pageBody pc' Which doesn't occur when I'm not trying to render "mainMenu" widget. What am I doing wrong? And are there any informations about using widgets anywhere? ( because I haven't found many.. )? Best regards Kamil Ciemniewski