Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using different Layout #1368

ElhamAfshar opened this issue Sep 28, 2019 · 2 comments


Copy link

commented Sep 28, 2019

I need to use different Layout in my project


This comment has been minimized.

Copy link

commented Sep 28, 2019

how can I use two different Layout ?
app.RegisterView(iris.HTML("web/view", ".html").Layout("layout.html"))


This comment has been minimized.

Copy link

commented Oct 8, 2019

Layout is single per view. You can change the default layout defined on your iris.HTML(...).Layout(...) from the handler itself, through context.ViewLayout("other_layout.html") method.


Lines 717 to 728 in c8e73f4

// ViewLayout sets the "layout" option if and when .View
// is being called afterwards, in the same request.
// Useful when need to set or/and change a layout based on the previous handlers in the chain.
// Note that the 'layoutTmplFile' argument can be set to iris.NoLayout || view.NoLayout
// to disable the layout for a specific view render action,
// it disables the engine's configuration's layout property.
// Look .ViewData and .View too.
// Example:
ViewLayout(layoutTmplFile string)

@kataras kataras added the question label Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.