帮助进行 tpl 编辑
我不知道我做了什么,但突然我的代码没有按预期运行。
我的菜单未正确显示,因为我缺少 UL 结束标签。
我玩了所附的代码,但什么也没有。附件是生成的代码:
缺少的 ul 位于第 71 行。
请帮助我。
PHP / TPL 代码:
<nav id="categories">
<ul class="dropdown dropdown-horizontal">
{checkActionsTpl location="tpl_widget_categories_start"}
{section name=thecat loop=$cat_array}
{if $lastspacer eq ""}{assign var=lastspacer value=$cat_array[thecat].spacercount}{/if}
{if $cat_array[thecat].auto_id neq 0}
{if $cat_array[thecat].spacercount < $submit_lastspacer}</ul></li>{/if}
{if $cat_array[thecat].spacercount > $submit_lastspacer}<ul>{/if}
<li{if $cat_array[thecat].principlecat neq 0} class="dir"{/if}>
<a href="{if $pagename eq "upcoming" || $groupview eq "upcoming"}
{$URL_queuedcategory, $cat_array[thecat].safename}
{else}
{$URL_maincategory, $cat_array[thecat].safename|replace:' ':'%20'}
{/if}
{php}
global $URLMethod;
if ($URLMethod==2) print "/";
{/php}">{$cat_array[thecat].name}</a>
{if $cat_array[thecat].principlecat eq 0}</li>{else}{/if}{assign var=submit_lastspacer value=$cat_array[thecat].spacercount}{/if}
{/section}
{checkActionsTpl location="tpl_widget_categories_end"}
{if $cat_array[thecat].spacercount < $submit_lastspacer}{$lastspacer|repeat_count:'</ul></li>'}{/if}
</ul></li>
</ul>
</nav>
I don't know what I did but suddendly my code isn't acting as it should.
My menu is not showing correctly because I am missing a UL closing tag.
I played with the attatched code but nothing. Attatched is the generated code:
This is what I want
and this is what I get
The missing ul is on line 71.
Please help me.
PHP / TPL Code:
<nav id="categories">
<ul class="dropdown dropdown-horizontal">
{checkActionsTpl location="tpl_widget_categories_start"}
{section name=thecat loop=$cat_array}
{if $lastspacer eq ""}{assign var=lastspacer value=$cat_array[thecat].spacercount}{/if}
{if $cat_array[thecat].auto_id neq 0}
{if $cat_array[thecat].spacercount < $submit_lastspacer}</ul></li>{/if}
{if $cat_array[thecat].spacercount > $submit_lastspacer}<ul>{/if}
<li{if $cat_array[thecat].principlecat neq 0} class="dir"{/if}>
<a href="{if $pagename eq "upcoming" || $groupview eq "upcoming"}
{$URL_queuedcategory, $cat_array[thecat].safename}
{else}
{$URL_maincategory, $cat_array[thecat].safename|replace:' ':'%20'}
{/if}
{php}
global $URLMethod;
if ($URLMethod==2) print "/";
{/php}">{$cat_array[thecat].name}</a>
{if $cat_array[thecat].principlecat eq 0}</li>{else}{/if}{assign var=submit_lastspacer value=$cat_array[thecat].spacercount}{/if}
{/section}
{checkActionsTpl location="tpl_widget_categories_end"}
{if $cat_array[thecat].spacercount < $submit_lastspacer}{$lastspacer|repeat_count:'</ul></li>'}{/if}
</ul></li>
</ul>
</nav>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只看代码,我认为你
在三个地方搞错了。你想要
Just looking at the code, I think you have
the wrong way round in three places. You want