kataras/blocks

[BUG] defaultLayoutName is not used

syrm opened this issue · 3 comments

syrm commented

Hello,

I think you forget to use defaultLayoutName in blocks.go in ExecuteTemplate :

func (v *Blocks) ExecuteTemplate(w io.Writer, tmplName, layoutName string, data interface{}) error {
	if v.reload {
		if err := v.Load(); err != nil {
			return err
		}
	}

	return v.executeTemplate(w, tmplName, layoutName, data)
}

It seems better with this code :

func (v *Blocks) ExecuteTemplate(w io.Writer, tmplName, layoutName string, data interface{}) error {
	if v.reload {
		if err := v.Load(); err != nil {
			return err
		}
	}

	if layoutName == "" {
		layoutName = v.defaultLayoutName
	}

	return v.executeTemplate(w, tmplName, layoutName, data)
}

I have same problem.

syrm commented

Any news ?

Hello @syrm, @TechMaster thanks and sorry for the huuugee delay, I really didn't see that one. I merged the PR.