iris icon indicating copy to clipboard operation
iris copied to clipboard

[BUG] template part Unable to load

Open chaodoing opened this issue 2 years ago • 5 comments

{{ part "head" . }} Unable to load

chaodoing avatar Dec 01 '23 02:12 chaodoing

Hello @chaodoing, can you please post the source code in order to be able to reproduce it?

kataras avatar Dec 25 '23 21:12 kataras

https://github.com/kataras/iris/tree/main/_examples/view/template_html_5 This example can not work. The header and body part defined by about.html can not show in the page

baiyuxiong avatar May 09 '24 01:05 baiyuxiong

I found the reason. image

When project started ,getBuiltinFuncs function is called for many times with different value of name parameter. When part function is called, The last value of name parameter is used.

For example: getBuiltinFuncs is called twice like this:

getBuiltinFuncs("a.html") getBuiltinFuncs("b.html")

Not matter which template is rendering, var fullPartName in "part" function will always be : b-head,

baiyuxiong avatar May 09 '24 06:05 baiyuxiong