Add CurrentURL template variable back (#37444)
Because some custom template users need it, also add a new test and comments
This commit is contained in:
@@ -163,6 +163,7 @@ func Contexter() func(next http.Handler) http.Handler {
|
||||
base := NewBaseContext(resp, req)
|
||||
ctx := NewWebContext(base, rnd, session.GetContextSession(req))
|
||||
ctx.Data.MergeFrom(middleware.CommonTemplateContextData())
|
||||
ctx.Data["CurrentURL"] = setting.AppSubURL + req.URL.RequestURI()
|
||||
ctx.Data["Link"] = ctx.Link
|
||||
|
||||
// PageData is passed by reference, and it will be rendered to `window.config.pageData` in `head.tmpl` for JavaScript modules
|
||||
|
||||
Reference in New Issue
Block a user