DEDE织梦CMS模板在runphp=yes的标签中调用其他field值

DEDE织梦CMS模板在runphp=yes的标签中调用其他field值:

织梦DEDECMS在runphp=yes的标签中怎么调用其他的field值呢?

 DEDECMS网站有强大的TAG自定义功能,但如果是在runphp=yes的情况下,就会无法使用[field]等标签,因为它不解释了(都变成PHP代码了,怎么会解析呢?)
怎么办?
在网上搜索了一下,没有找到解决方法。想了很久终于想出一个临时性的解决方法,即用全局变量来解决这个问题。。
{dede:php}$GLOBALS['xxoo']=$arc->Fields['fieldname']{/dede:php}
{dede:field.xxxx runphp="yes"}@me="test".@me."-test".$GLOBALS['xxoo'];{/dede:field.xxxx}
即,先开一个PHP的标签,把想赋的值替换给global变量。然后在另外的运行中将field值赋值给他。 

问题是能够解决了,但是还是不完美,有待高手提供更好的解决办法。

{dede:php}$GLOBALS['aid']=$arc->Fields['aid']{/dede:php}
                        {dede:field.andresid runphp='yes'}
                        if (@me  <> '') @me = '<a class="downBtn androidDown" href="/plus/app_download.php?resid='.urlencode(authcode(@me)).'&amp;app_type='.urlencode(authcode(1)).'&amp;aid='.$GLOBALS['aid'].'" target="_blank">免费下载</a>';

猜你喜欢

转载自hao3721.iteye.com/blog/1869430