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
error calling partial: html/template: "css-home/home" is undefined #50
Comments
If you take a look to the source code in the "render.go" it says:
As I understand, when it's processing / walking the templates directory, it ignores folders. |
Thanks @b-jufre let me check |
@kyaw9 It has nothing to do with that code, because subdirectories are already implemented as you can read in the documentation and the render_html_test.go. It has to do with the way "partial" function works. It prepends the partial name you specify, in this case "css", to the template name you pass in "r.HTML(.... "home/home", ...)", so it becomes "css-home/home". Try defining the partial as "css-home/home", instead of just "css-home", this way you are following the nested structure you have.
Let me know if it works :) |
Thanks @b-jufre . I will let you know. |
@b-jufre It is work. Thanks for your time. |
Glad to hear it's working! Can this issue be closed? |
@unrolled I think so! |
When I use template with sub folder, I found follow error in partial rendering.
"error calling partial: html/template: "css-home/home" is undefined"
My template folder structure is
/views/layout/layout.tmpl
/views/home/home.tmpl
Sample Code!
The text was updated successfully, but these errors were encountered: