{"action":"created","issue":{"url":"https://api.github.com/repos/kataras/iris/issues/435","repository_url":"https://api.github.com/repos/kataras/iris","labels_url":"https://api.github.com/repos/kataras/iris/issues/435/labels{/name}","comments_url":"https://api.github.com/repos/kataras/iris/issues/435/comments","events_url":"https://api.github.com/repos/kataras/iris/issues/435/events","html_url":"https://github.com/kataras/iris/issues/435","id":178263079,"number":435,"title":"iris.NoLayout err","user":{"login":"zjb0807","id":16496415,"avatar_url":"https://avatars.githubusercontent.com/u/16496415?v=3","gravatar_id":"","url":"https://api.github.com/users/zjb0807","html_url":"https://github.com/zjb0807","followers_url":"https://api.github.com/users/zjb0807/followers","following_url":"https://api.github.com/users/zjb0807/following{/other_user}","gists_url":"https://api.github.com/users/zjb0807/gists{/gist_id}","starred_url":"https://api.github.com/users/zjb0807/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zjb0807/subscriptions","organizations_url":"https://api.github.com/users/zjb0807/orgs","repos_url":"https://api.github.com/users/zjb0807/repos","events_url":"https://api.github.com/users/zjb0807/events{/privacy}","received_events_url":"https://api.github.com/users/zjb0807/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-21T07:00:39Z","updated_at":"2016-09-21T07:13:38Z","closed_at":null,"body":"my versions is 4.2.9, i have tried the two ways to return nolayout, but failed\r\nctx.Render(\"login.html\", nil, iris.RenderOptions{\"layout\": iris.NoLayout})\r\nctx.MustRender(\"login.html\", nil, iris.RenderOptions{\"layout\": iris.NoLayout}) \r\n\r\nerrors:\r\n[IRIS] 2016/09/15 18:33:02 MustRender panics for client with IP: 192.168.20.1 On template: login.html.Trace: html/template: \"@.|.@no_layout@.|.@\" is undefine\r\n"},"comment":{"url":"https://api.github.com/repos/kataras/iris/issues/comments/248530290","html_url":"https://github.com/kataras/iris/issues/435#issuecomment-248530290","issue_url":"https://api.github.com/repos/kataras/iris/issues/435","id":248530290,"user":{"login":"kataras","id":2321588,"avatar_url":"https://avatars.githubusercontent.com/u/2321588?v=3","gravatar_id":"","url":"https://api.github.com/users/kataras","html_url":"https://github.com/kataras","followers_url":"https://api.github.com/users/kataras/followers","following_url":"https://api.github.com/users/kataras/following{/other_user}","gists_url":"https://api.github.com/users/kataras/gists{/gist_id}","starred_url":"https://api.github.com/users/kataras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kataras/subscriptions","organizations_url":"https://api.github.com/users/kataras/orgs","repos_url":"https://api.github.com/users/kataras/repos","events_url":"https://api.github.com/users/kataras/events{/privacy}","received_events_url":"https://api.github.com/users/kataras/received_events","type":"User","site_admin":false},"created_at":"2016-09-21T07:13:38Z","updated_at":"2016-09-21T07:13:38Z","body":"Dear @zjb0807 \r\n\r\nI have tried to re-produce the issue, but I couldn't, could you please give us more details or the full source code snippet of your handler?\r\n\r\nThis is the code I ran and worked: \r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"github.com/kataras/go-template/html\"\r\n\t\"github.com/kataras/iris\"\r\n)\r\n\r\nfunc main() {\r\n\t// directory and extensions defaults to ./templates, .html for all template engines\r\n\tiris.UseTemplate(html.New(html.Config{Layout: \"layouts/layout.html\"}))\r\n\t//iris.Config.Render.Template.Gzip = true\r\n\tiris.Get(\"/\", func(ctx *iris.Context) {\r\n\t\tif err := ctx.Render(\"page1.html\", nil); err != nil {\r\n\t\t\tprintln(err.Error())\r\n\t\t}\r\n\t})\r\n\r\n\t// remove the layout for a specific route\r\n\tiris.Get(\"/nolayout\", func(ctx *iris.Context) {\r\n\t\tif err := ctx.Render(\"page1.html\", nil, iris.RenderOptions{\"layout\": iris.NoLayout}); err != nil {\r\n\t\t\tprintln(err.Error())\r\n\t\t}\r\n\t})\r\n\r\n\t// set a layout for a party, .Layout should be BEFORE any Get or other Handle party's method\r\n\tmy := iris.Party(\"/my\").Layout(\"layouts/mylayout.html\")\r\n\t{\r\n\t\tmy.Get(\"/\", func(ctx *iris.Context) {\r\n\t\t\tctx.MustRender(\"page1.html\", nil)\r\n\t\t})\r\n\t\tmy.Get(\"/other\", func(ctx *iris.Context) {\r\n\t\t\tctx.MustRender(\"page1.html\", nil)\r\n\t\t})\r\n\t}\r\n\r\n\tiris.Listen(\":8080\")\r\n}\r\n\r\n\r\n```\r\n\r\nMaybe you have an old version of the `kataras/go-template` package, try this:\r\n\r\n- remove `$GOPATH/src/github.com/kataras` and `$GOPATH/src/github.com/iris-contrib` \r\n- open your shell and execute: `go get -u github.com/kataras/iris` \r\n- try again and write the results to this thread\r\n\r\nThanks,\r\nkataras"}}
{"actor":{"display_login":"kataras"}}