CMS Development

chaseindustries
Participant

Anchor with "#" href opening a new tab

When I need to preview a module that uses an anchor tag with a hash, the link opens a new tab instead of staying on the page. I'm then presented with an error message.

 

Steps to reproduce:

- Create a page or module that has <a href="#">Test</a> in it

- Preview the page from the design manager

- Click on the link

 

I think the reason for this is the source for the preview page contains a <base> tag that hijacks all of the links on the page.

0 Upvotes
1 Reply 1
alyssamwilie
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Anchor with "#" href opening a new tab

Yea, I'm not seeing anyway around that in the module preview and not sure why they have it set up like that. The simplest solution I can think of here is to add the module to a draft page and test it on a page preview instead of in the module preview.

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.