目标 _blank "conditions"
Target _blank "conditions"
我只需要 "Home" 和 "Contact" 看起来像 "target=_self",其余的看起来像 "target=_blank"(在新选项卡中打开)
这是菜单代码:
<div class='art-nav desktop-nav'>
<b:section id='crosscol' maxwidgets='1' showaddelement='no'>
<b:widget id='PageList98' locked='false' title='Pages' type='PageList' version='1'>
<b:widget-settings>
<b:widget-setting name='pageListJson'><![CDATA[{'home': {'href': 'https://www.henshinnews.com/', 'title': 'Home', 'position': 0}, '132343047507310766': {'href': 'https://www.henshinnews.com/p/contato_39.html', 'title': 'Contato', 'position': 1}, 'link0': {'href': 'https://www.facebook.com/henshinnews/', 'title': 'Facebook', 'position': 2}, 'link1': {'href': 'https://twitter.com/HenshinNews', 'title': 'Twitter', 'position': 3}, 'link2': {'href': 'http://feeds.feedburner.com/HenshinNews', 'title': 'Feed RSS', 'position': 4}}]]></b:widget-setting>
<b:widget-setting name='homeTitle'>Home</b:widget-setting>
</b:widget-settings>
<b:includable id='main'>
<ul class='art-hmenu'>
<b:loop values='data:links' var='link'>
<b:if cond='data:link.isCurrentPage'>
<li><a class='active' expr:href='data:link.href'><data:link.title/></a></li>
<b:else/>
<li><a expr:href='data:link.href'><data:link.title/></a></li>
</b:if>
</b:loop>
</ul>
</b:includable>
</b:widget>
</b:section>
<script>
artFixTopPagesMenu();
</script>
</div>
这是我的网站:www.henshinnews.com
您需要使用条件标签来检查 link 标题并添加所需的目标属性。
试试这个:
<div class='art-nav desktop-nav'>
<b:section id='crosscol' maxwidgets='1' showaddelement='no'>
<b:widget id='PageList98' locked='false' title='Pages' type='PageList' version='1'>
<b:widget-settings>
<b:widget-setting name='pageListJson'><![CDATA[{'home': {'href': 'https://www.henshinnews.com/', 'title': 'Home', 'position': 0}, '132343047507310766': {'href': 'https://www.henshinnews.com/p/contato_39.html', 'title': 'Contato', 'position': 1}, 'link0': {'href': 'https://www.facebook.com/henshinnews/', 'title': 'Facebook', 'position': 2}, 'link1': {'href': 'https://twitter.com/HenshinNews', 'title': 'Twitter', 'position': 3}, 'link2': {'href': 'http://feeds.feedburner.com/HenshinNews', 'title': 'Feed RSS', 'position': 4}}]]></b:widget-setting>
<b:widget-setting name='homeTitle'>Home</b:widget-setting>
</b:widget-settings>
<b:includable id='main'>
<ul class='art-hmenu'>
<b:loop values='data:links' var='link'>
<b:if cond='data:link.title == "Home" or data:link.title == "Contato"'>
<b:if cond='data:link.isCurrentPage'>
<li><a class='active' expr:href='data:link.href' target='_self'><data:link.title/></a></li>
<b:else/>
<li><a expr:href='data:link.href' target='_self'><data:link.title/></a></li>
</b:if>
<b:else/>
<b:if cond='data:link.isCurrentPage'>
<li><a class='active' expr:href='data:link.href' target='_blank'><data:link.title/></a></li>
<b:else/>
<li><a expr:href='data:link.href' target='_blank'><data:link.title/></a></li>
</b:if>
</b:if>
</b:loop>
</ul>
</b:includable>
</b:widget>
</b:section>
<script>
artFixTopPagesMenu();
</script>
</div>
我只需要 "Home" 和 "Contact" 看起来像 "target=_self",其余的看起来像 "target=_blank"(在新选项卡中打开)
这是菜单代码:
<div class='art-nav desktop-nav'>
<b:section id='crosscol' maxwidgets='1' showaddelement='no'>
<b:widget id='PageList98' locked='false' title='Pages' type='PageList' version='1'>
<b:widget-settings>
<b:widget-setting name='pageListJson'><![CDATA[{'home': {'href': 'https://www.henshinnews.com/', 'title': 'Home', 'position': 0}, '132343047507310766': {'href': 'https://www.henshinnews.com/p/contato_39.html', 'title': 'Contato', 'position': 1}, 'link0': {'href': 'https://www.facebook.com/henshinnews/', 'title': 'Facebook', 'position': 2}, 'link1': {'href': 'https://twitter.com/HenshinNews', 'title': 'Twitter', 'position': 3}, 'link2': {'href': 'http://feeds.feedburner.com/HenshinNews', 'title': 'Feed RSS', 'position': 4}}]]></b:widget-setting>
<b:widget-setting name='homeTitle'>Home</b:widget-setting>
</b:widget-settings>
<b:includable id='main'>
<ul class='art-hmenu'>
<b:loop values='data:links' var='link'>
<b:if cond='data:link.isCurrentPage'>
<li><a class='active' expr:href='data:link.href'><data:link.title/></a></li>
<b:else/>
<li><a expr:href='data:link.href'><data:link.title/></a></li>
</b:if>
</b:loop>
</ul>
</b:includable>
</b:widget>
</b:section>
<script>
artFixTopPagesMenu();
</script>
</div>
这是我的网站:www.henshinnews.com
您需要使用条件标签来检查 link 标题并添加所需的目标属性。
试试这个:
<div class='art-nav desktop-nav'>
<b:section id='crosscol' maxwidgets='1' showaddelement='no'>
<b:widget id='PageList98' locked='false' title='Pages' type='PageList' version='1'>
<b:widget-settings>
<b:widget-setting name='pageListJson'><![CDATA[{'home': {'href': 'https://www.henshinnews.com/', 'title': 'Home', 'position': 0}, '132343047507310766': {'href': 'https://www.henshinnews.com/p/contato_39.html', 'title': 'Contato', 'position': 1}, 'link0': {'href': 'https://www.facebook.com/henshinnews/', 'title': 'Facebook', 'position': 2}, 'link1': {'href': 'https://twitter.com/HenshinNews', 'title': 'Twitter', 'position': 3}, 'link2': {'href': 'http://feeds.feedburner.com/HenshinNews', 'title': 'Feed RSS', 'position': 4}}]]></b:widget-setting>
<b:widget-setting name='homeTitle'>Home</b:widget-setting>
</b:widget-settings>
<b:includable id='main'>
<ul class='art-hmenu'>
<b:loop values='data:links' var='link'>
<b:if cond='data:link.title == "Home" or data:link.title == "Contato"'>
<b:if cond='data:link.isCurrentPage'>
<li><a class='active' expr:href='data:link.href' target='_self'><data:link.title/></a></li>
<b:else/>
<li><a expr:href='data:link.href' target='_self'><data:link.title/></a></li>
</b:if>
<b:else/>
<b:if cond='data:link.isCurrentPage'>
<li><a class='active' expr:href='data:link.href' target='_blank'><data:link.title/></a></li>
<b:else/>
<li><a expr:href='data:link.href' target='_blank'><data:link.title/></a></li>
</b:if>
</b:if>
</b:loop>
</ul>
</b:includable>
</b:widget>
</b:section>
<script>
artFixTopPagesMenu();
</script>
</div>