在易优这边只有单页模型的栏目才有封面页内容

易优教程 强烈建议 2024-03-15 07:33 103 0

  如果网站不是v1.5.4版本,请先升级到最新版v1.5.5

  ,下载以下补丁包,然后解压覆盖到网站根目录下。

  点击这里下载,支持sql标签的补丁包

  下面我们将织梦易优的sql标签进行对比转换,大家在学习时留意两个系统语法的相似之处。

  注意事项:

  1、示例中 __PREFIX__ 代表数据表的前缀,假设你安装网站时数据表前缀是ey_,那么 __PREFIX__arctype 就是 ey_arctype

  ------------------------------- 示例1 ----------------------------

  织梦:调用指定栏目的封面页内容,比如栏目ID是1

  {dede:sql sql="select content from dede_arctype where id=1"}

  [field:content function=cn_substr(Html2Text(@me),600)/]

  {/dede:sql}

  易优:指定栏目的封面页内容,比如栏目ID是1,在易优这边只有单页模型的栏目才有封面页内容

  {eyou:sql sql='select content from `__PREFIX__single_content` where typeid = 1' id='field'}

  {$field.content|html_msubstr=###,0,300,true}

  {/eyou:sql}

  或者

  {eyou:type typeid='1' addfields='content' id='field'}

  {$field.content|html_msubstr=###,0,300,true}

  {/eyou:type}

  ------------------------------- 示例2 ----------------------------

  织梦:调用指定栏目的数据,比如栏目ID是1

  {dede:sql sql="select * from dede_arctype where id=1"}

  栏目ID:[field:id/]

  栏目名称:[field:typename/]

  栏目链接:[field:typelink/]

  {/dede:sql}

  易优:调用指定栏目的数据,比如栏目ID是1

  {eyou:sql sql='select * from `__PREFIX__arctype` where id = 1' id='field'}

  栏目ID:{$field.id}

  栏目名称:{field:typename}

  栏目链接:{field:typeurl}

  {/eyou:sql}

  或者

  {eyou:type typeid='1' id='field'}

  栏目ID:{$field.id}

  栏目名称:{field:typename}

  栏目链接:{field:typeurl}

  {/eyou:type}

  ------------------------------- 示例3,sql标签可以用php标签代替 ----------------------------

  织梦:调用指定栏目的数据,比如栏目ID是1

  {dede:sql sql="select * from dede_arctype where id=1"}

  栏目ID:[field:id/]

  栏目名称:[field:typename/]

  栏目链接:[field:typelink/]

  {/dede:sql}

  易优:调用指定栏目的数据,比如栏目ID是1

  {eyou:php}

  $sql = 'select * from ey_arctype';

  $tmp_list = db()->query($sql);

  foreach ($tmp_list as $_k => $_v) {

  echo "栏目ID:".$_v['id'];

  echo " -- ";

  echo "栏目名称:".$_v['typename'];

  echo " -- ";

  echo "栏目链接:".typeurl('home/Lists/index', $_v);

  echo "
";

  }

  {/eyou:php}

本站资源均来自互联网或会员发布,如果不小心侵犯了您的权益请与我们联系。我们将立即删除!谢谢!