Hi everyone,
I am trying to programatically exclude a section of the MAIN (template) from pages in my application, depending on their path.
I was hoping to have something like the following in my MAIN file;
@if(request.path !="/"){ ... }
So that I can maintain the menu in one place (MAIN) for the entire application.
I have added (implicit request: Request) to my MAIN and INDEX pages (and XOR) individually.
Also; the controller for the index page is;
def index: Action[AnyContent] = Action {implicit request =>
Ok(au.com.ecpr.pas.views.html.index())
}
With Implicit declared in both I get;
trait Request takes type parameters
With it JUST declared in the INDEX page I get;
object path is not a member of package play.api.mvc.request
I have also tried with;
(implicit request : RequestHeader)
:- but get;
Cannot find any HTTP Request Header here
I have absolutely no idea what I am doing wrong - and would love some help please.
Lastly I could see it being a good addition to the documentation - retrieving data about the request would seems to be a common use-case?
Thanks.