Q:

Yesod: Could not access LoginR in another Handler

I am very new to Haskell and as you can guess new to Yesod as well. I wanted to play around with both as a way to learn a bit more about Haskell and web development. 
I have two issues and both of them could be silly mistakes I am making due to my lack of Haskell knowledge:
(1) I created a scaffold site with sqlite (I am using Yesod 1.2). I tried adding just one additional line in the generated homepage.hamlet file and it gives me an error (btw, the site works fine without this addition). The line I added was: 
<a href=@{AuthR LoginR}>Go to the login page

After that I get this error message: 
Handler/Home.hs:34:11:
Not in scope: data constructor `LoginR'
In the result of the splice:
  $(widgetFile "homepage")
To see what the splice expanded to, use -ddump-splices
In a stmt of a 'do' block: $(widgetFile "homepage")
In the second argument of `($)', namely
  `do { aDomId <- newIdent;
        setTitle "Welcome To Yesod!";
        $(widgetFile "homepage") }'

Is there a way to expose LoginR in other Handlers/templates? 
(2) I eventually want to customize the login page look and feel so I tried to follow the instructions here (also thought this may address the above issue since I am declaring my own Handler in scope) : http://hackological.com/blog/using-twitter-to-authenticate-in-yesod/. Basically I modified Foundation.hs's authRoute statement as follows
authRoute _ = Just LoginPanelR

and then added the route: 
/login LoginPanelR GET

and added the handler in Home.hs
getLoginPanelR :: Handler RepHtml
getLoginPanelR = defaultLayout $(widgetFile "login")

I also created the corresponding login.hamlet file with contents provided in the link. I then get the following error: 
Foundation.hs:100:32:
Couldn't match type `App' with `Auth'
Expected type: Route Auth
  Actual type: Route App
In the first argument of `AuthR', namely `LoginPanelR'
In the second argument of `($)', namely `AuthR LoginPanelR'
In the expression: Just $ AuthR LoginPanelR

Could you please let me know what I am doing wrong? 
Thanks!

A:

For (1), just import Yesod.Auth. For (2): it looks like, in your Hamlet template, you're using AuthR LoginPanelR. However, LoginPanelR is not part of the auth subsite, so the AuthR should be omitted.

