[Skip to main content](#vessel-content)

#   Link does not open in new tab

##

- **[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")**
- [![MaartenVdp's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31636-maartenvdp "View MaartenVdp's Profile") Topic Author
- [ Offline](/forum/user/31636-maartenvdp)

Less More

- Posts: 18
- Thank you received: 0
-
-

12 years 3 months ago -  12 years 3 months ago [\#162280](#162280) by [MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")  *[Link does not open in new tab](/forum/26-product-category-display/869368-link-does-not-open-in-new-tab#162280 "I have an editor which is launched within hikashop. When a photo is created through the editor, I submit it to the cart via the &quot;update cart&quot; url. I have a custom field which will hold the value of the link to that created photo (see attachment &quot;uw foto: url&quot;). I'm not wondering how I can make sure that the link is opened in a new tab. Whenever I add target=&quot;blank&quot; for that url, it gets removed...")* was created by *[MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile")*

I have an editor which is launched within hikashop.
When a photo is created through the editor, I submit it to the cart via the "update cart" url.
I have a custom field which will hold the value of the link to that created photo (see attachment "uw foto: url").
I'm not wondering how I can make sure that the link is opened in a new tab. Whenever I add target="blank" for that url, it gets removed...

- [ ![hf337d38.png](/forum/attachment/18186) ](/forum/attachment/18186 "hf337d38.png") [ ](/forum/attachment/18186?download=1 "hf337d38.png")

Last edit: 12 years 3 months ago by [MaartenVdp](/forum/user/31636-maartenvdp "View MaartenVdp's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjkzNjgtbGluay1kb2VzLW5vdC1vcGVuLWluLW5ldy10YWI/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")**
- [![lousyfool's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar28604.jpg)](/forum/user/28604-lousyfool "View lousyfool's Profile")
- [ Offline](/forum/user/28604-lousyfool)

Less More

- Posts: 2143
- Thank you received: 747
-
- [](http://www.inphase.one)
-

12 years 3 months ago [\#162317](#162317) by [lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")  Replied by *[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")* on topic *[Link does not open in new tab](/forum/26-product-category-display/869368-link-does-not-open-in-new-tab#162317 "I have an editor which is launched within hikashop. When a photo is created through the editor, I submit it to the cart via the &quot;update cart&quot; url. I have a custom field which will hold the value of the link to that created photo (see attachment &quot;uw foto: url&quot;). I'm not wondering how I can make sure that the link is opened in a new tab. Whenever I add target=&quot;blank&quot; for that url, it gets removed...")*

The correct attribute is target="_blank" (with the underscore). For example Code:

&lt;a href="http://www.your-link.com" target="_blank"&gt;My Link&lt;/a&gt;

Try that and it should work.

---

Need help with customisations of layouts, style or other site development? [ PM me!](/component/uddeim/?task=new)
(Don't forget to turn on [ "E-mail notification of new messages"](/component/uddeim/?task=settings))

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjkzNjgtbGluay1kb2VzLW5vdC1vcGVuLWluLW5ldy10YWI/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86292
- Thank you received: 14271
-
-

12 years 3 months ago [\#162281](#162281) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Link does not open in new tab](/forum/26-product-category-display/869368-link-does-not-open-in-new-tab#162281 "I have an editor which is launched within hikashop. When a photo is created through the editor, I submit it to the cart via the &quot;update cart&quot; url. I have a custom field which will hold the value of the link to that created photo (see attachment &quot;uw foto: url&quot;). I'm not wondering how I can make sure that the link is opened in a new tab. Whenever I add target=&quot;blank&quot; for that url, it gets removed...")*

Hi,

If you use a custom field of the type "file" and provide to it the name of the file that you saved in the upload secure folder of HikaShop, the custom field would automatically display a link to it with a target="_blank" on it.
So in such respect, there would actually be nothing to change.
So I'm not sure how you configured your custom field nor how you add the link to the file in the custom field. Did you use a custom field "text" type and then added the a HTML tag directly in its content ? In that case, it's normal that the attribute is removed. That is done by the filtering system in order to avoid XSS injection attacks via custom fields. It's possible to deactivate that filtering for your custom field by turning off the "input filtering" option of the custom field, but I don't recommend that for custom fields where the value is added in the frontend as it would make your website vulnerable to such attacks. A safer solution would be to edit the file "cart" of the view checkout" via the menu Display&gt;Views and change the code:
$this-&gt;fieldsClass-&gt;show($field,$row-&gt;$namekey)

to:
str_replace('&lt;a ','&lt;a target="_blank" ',$this-&gt;fieldsClass-&gt;show($field,$row-&gt;$namekey))

That way, the target would be added server-side.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NjkzNjgtbGluay1kb2VzLW5vdC1vcGVuLWluLW5ldy10YWI/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.160 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
