在新标签/窗口中打开我的链接 [英] Make my links open in a new tab/window

查看:67
本文介绍了在新标签/窗口中打开我的链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个需要修改的CMS。我希望外部链接在新窗口中打开target =_ blank



下面是代码:



<?php foreach($ this->菜单为$ menu){?>

< a href =<?php echo $ menu-> type =='外部'?$ menu->链接:/ Index / Content / Id / {$ menu-> id}?>>



< b>我尝试了什么:



<?php echo($ menu-> type =='External')? {$ menu-> link} target = _blank:/ Index / Content / Id / {$ menu-> id}?>

I have a CMS that I need to modify. I want the external links to open in a new window target="_blank"

Heres the code:

<?php foreach ($this->menus as $menu) { ?>
<a href="<?php echo $menu->type == 'External' ? $menu->link : "/Index/Content/Id/{$menu->id}" ?>">

What I have tried:

<?php echo ($menu->type == 'External') ? "{$menu->link} target=_blank" : "/Index/Content/Id/{$menu->id}" ?>

推荐答案

this->菜单为
this->menus as


菜单){?>

< a href =<?php echo
menu) { ?>
<a href="<?php echo

menu-> type =='External'?
menu->type == 'External' ?


这篇关于在新标签/窗口中打开我的链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆