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

Option to disable Default Template Layout #51

Closed
ghost opened this issue May 26, 2017 · 14 comments
Closed

Option to disable Default Template Layout #51

ghost opened this issue May 26, 2017 · 14 comments
Assignees
Labels
aah Framework scope enhancement

Comments

@ghost
Copy link

ghost commented May 26, 2017

Not all templates use Layout, can you cancel DefaultTmplLayout?

if ess.IsStrEmpty(htmlRdr.Layout) {
	htmlRdr.Layout = appDefaultTmplLayout
}
@jeevatkm jeevatkm self-assigned this May 27, 2017
@jeevatkm jeevatkm added aah Framework scope enhancement labels May 27, 2017
@jeevatkm jeevatkm added this to the v0.6 Milestone milestone May 27, 2017
@jeevatkm
Copy link
Member

One of the notable feature in aah framework is multi layout and its flexibility. I understand your application need.

I will provide a configuration option to disable DefaultTmplLayout?

@jeevatkm jeevatkm changed the title Not required Tmpl Layout Option to disable Default Template Layout May 27, 2017
@jeevatkm
Copy link
Member

For now create an empty layout file, something like nolayout.html and call

HTMLlf("nolayout.html", "/path/to/tmplfile.html", data)

@ghost
Copy link
Author

ghost commented May 27, 2017

thank you

jeevatkm added a commit to go-aah/tools that referenced this issue May 27, 2017
@ghost
Copy link
Author

ghost commented May 27, 2017

@jeevatkm
default_layout = false
View not found: views\pages\frontend\index\index.html

aah/view.go

Line 183 in 10f79df

if htmlRdr.Template, err = appViewEngine.Get(htmlRdr.Layout, tmplPath, tmplName); err != nil {

https://github.com/go-aah/view/blob/v0-unstable/go_engine.go#L70

@jeevatkm
Copy link
Member

Did you manually apply commit changes into your local codebase?

@ghost
Copy link
Author

ghost commented May 27, 2017

I have not processed yet

@jeevatkm
Copy link
Member

@Lesou this config option to be release in v0.6. If you would like to try now, please do these steps.

Patch files created from commit sha.

# go to directory
cd $GOPATH/src/aahframework.org/aah.v0

# run this
git reset --hard HEAD
patch -p1 < 0001-50-tmpl-auto-resolve-fix-and-enhancement.txt
patch -p1 < 0001-51-config-option-to-disable-default-tmpl-layout.txt

Now test it and let me know.

@ghost
Copy link
Author

ghost commented May 27, 2017

hello, not yet solved

$ patch -p1 < 0001-50-tmpl-auto-resolve-fix-and-enhancement.txt
patching file aah_test.go
patching file context.go
patching file context_test.go
patching file controller.go
patching file engine_test.go
patching file middleware.go
patching file util.go
patching file view.go
patching file view_test.go

$ patch -p1 < 0001-51-config-option-to-disable-default-tmpl-layout.txt
patching file view.go
patching file view_test.go

aah.conf

default_layout = false

2017-05-27 11:10:09.685 ERROR template not found: views\pages\frontend\index\index.html

default_layout = true Normal use。

@jeevatkm
Copy link
Member

I will check and get back to you, thanks.

@jeevatkm
Copy link
Member

@Lesou Can you apply this patch also and test it?

view-nolayout.txt

# go to directory
cd $GOPATH/src/aahframework.org/view.v0

# run this
git apply --ignore-space-change --ignore-whitespace view-nolayout.txt

@ghost
Copy link
Author

ghost commented May 27, 2017

solve, thank you

@jeevatkm
Copy link
Member

I'm glad to hear that, thanks.

BTW, I have a question. when you say no layout? do you mean you don't have header, footer etc. for the certain pages?

jeevatkm added a commit to go-aah/view that referenced this issue May 27, 2017
@ghost
Copy link
Author

ghost commented May 27, 2017

Yes, i am using angular2,Do not need title, footer and so on

jeevatkm added a commit to go-aah/view that referenced this issue May 27, 2017
@jeevatkm
Copy link
Member

Implemented, to be released with v0.6.

jeevatkm added a commit to go-aah/app-templates that referenced this issue Jul 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aah Framework scope enhancement
Projects
None yet
Development

No branches or pull requests

1 participant