Please forgive me for a weird looking question. I wasn't sure exactly how to state my problem in a single statement.
I have three templates in my webpage, header, layout and footer.
In the template header, I have a categories dropdown menu and I have a slice of strings with sub-menu items in my go code.
Categories := []string{"Holiday","IQ","Future"}
and the template header has following html code
<div class="ui dropdown item">
<i class="browser icon"></i>
Categories
<i class="dropdown icon"></i>
<div class="menu">
{{range $i,$e:= .}}
<a class="item"><i class="hashtag icon"></i>{{$e}}</a>
{{end}}
</div>
</div>
so when I do a,
t,err :=template.ParseFiles("template/header.html","template/index.html","template/footer.html")
t.ExecuteTemplate(w,"header",Categories)
It gives me a nice looking header but I need to do
t.ExecuteTemplate(w,"layout",Featured)
for the main page. Layout template has the following structure
some html code
{{template "header"}}
more html code
{{template "footer"}}
Using both the execute template statements together gives me two different headers,obviously.
If I remove template header from the template layout, the visual output is perfect but when you look at the html code, the menu bar is above the "link rel" statements(remember,I had 'some html code' above {{template "header"}} in the layout template) and that is obviously not good.
What should I do so that both the templates are executed simultaneously using their respective structs?