可以esi:include src在html页面中用作esi变量

时间:2015-08-28 16:28:18

标签: html akamai esi

示例:

问题与esi:assign和esi:包含在通过akamai cdn呈现的html页面中

http://www.trial.com/abc/def/ghjiy (Akamai rendering src) has content "abc"

In an html page
<esi:include src="http://www.trial.com/abc/def/ghjiy"></esi:include> will return "abc"
can I assign this to a variable so we can use it multiple times in the html  page using 
<esi:vars>$(val)</esi:vars>

I have tried something like this 
<esi:text><esi:assign name="val">'</esi:text><esi:include 
src="http://www.trial.com/abc/def/ghjiy"></esi:include><esi:text>'</esi:assign></esi:text>"

But after html page being rendered the <esi:assign> tags has not been parsed and returned 
the following in page source
<esi:assign name="val">abc</esi:assign>

1 个答案:

答案 0 :(得分:1)

您可以使用esi:eval代替esi:include

http://www.trial.com/abc/def/ghjiy 可以返回将在边缘评估的esi代码片段。例如:    <esi assign name="val">I assign this to a variable so we can use it multiple times in the html page using</esi:assign>

然后你可以使用    <esi:vars>$(val)</esi:vars>