|
需求
有二级栏目时一级栏目的Url输出 javascript:; 只有一级栏目就输出链接
解答
判断是否有子栏目,有就输出 javascript:; ,没有子栏目就直接输出一级栏目的链接
{dede:field name=typeid runphp=yes}global $dsql;$row = $dsql->GetOne("select * from `58pic_arctype` where reid='@me' and ishidden1 order by sortrank asc limit 0]1");if(is_array($row)) @me = 'javascript:;'; else @me = GetOneTypeUrlA($dsql->GetOne("select * from `58pic_arctype` where id='@me' and ishidden1"));{/dede:field}
织梦二次开发示范
{dede:channelartlist row=7 typeid=top currentstyle=current}
[*,
[url=,GetOne("select * from `58pic_arctype` where reid='@me' and ishidden1 order by sortrank asc limit 0]1");if(is_array($row)) @me = 'javascript:;'; else @me = GetOneTypeUrlA($dsql->GetOne("select * from `58pic_arctype` where id='@me' and ishidden1"));{/dede:field}">{dede:field.typename/}{dede:channel type='son' row=1 noself='yes'}[i,[/i,{/dede:channel}[/url]
{dede:channel type='son' row=1 noself='yes'}
{/dede:channel}
{dede:channel type='son' noself='yes'}
[*,[url=,[field:typename/][/url]
{/dede:channel}
{dede:channel type='son' row=1 noself='yes'}
{/dede:channel}
{/dede:channelartlist}
结果
|
|