Expression Engine变量传入模板时遇到一些麻烦.
有一些代码:
//查询:
{exp:channel:entries
channel="static"
}
Run Code Online (Sandbox Code Playgroud)
//在循环中重复字段
{content_matrix}
<div>
{text_cell}
</div>
{image}
{/content_matrix}
Run Code Online (Sandbox Code Playgroud)
//
{/exp:channel:entries}
Run Code Online (Sandbox Code Playgroud)
我想将content_matrix字段与大内部HTML(示例较短)sctructure一起移动到单独的嵌入模板中,以便在其他模板中重用.
试图构建这样的嵌入但它不起作用:
{embed="incl/content_matrix" matrix="{content_matrix}"}
Run Code Online (Sandbox Code Playgroud)
和小模板的身体:
{embed:matrix}
<div>
{text_cell}
</div>
{image}
{/embed:matrix}
Run Code Online (Sandbox Code Playgroud)
通过这种方式,如果您传递单个元素(如ID),但不能传递mupltiple元素.也许它需要通过整个条目.
怎么做?
谢谢.