• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Target attribute in BC Dynamic menus?

Mentor ,
Feb 28, 2012 Feb 28, 2012

Copy link to clipboard

Copied

Question:

Is it possible to add a target attribute to a link that appears in a BC dynamic menu?  I'm adding a few things to external sites and want a new tab / window opened ("_blank") rather than the default ("_self" ) behavior.  Can this be done?

Answer:

If you go to Site Settings -> Menu -> select a menu and then click on the menu item you want to open in a new window, you'll find a Target Frame field on that page. You need to place _blank into that field and it will be rendered on the frontend as a target="_blank" attribute.

TOPICS
Content management and modules

Views

4.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 30, 2012 Apr 30, 2012

Copy link to clipboard

Copied

Hi Mario,

I have my two links in my menu that need to open in a new window and in the Target frame field I have placed _blank but it still opens in the same window, any idea on what may be causing it?

my site:  clawmoney.businesscatalyst.com

the two menu items that need to open in a new window: "BLOGUE" and "CLAWFEE TALK"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 30, 2012 Apr 30, 2012

Copy link to clipboard

Copied

Hey there..

Couple of questions..

- Did you use the Version 2 menu module?

- You using the menu module at all?

The way that menu is html and javascript is does not appear to be using the BC menu module. When you change a link or text in the admin is your menu updating?

If it is the Version 2 you need to update the menu layout to include that.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 30, 2012 Apr 30, 2012

Copy link to clipboard

Copied

Hi Liam,

Thank you for the quick reply, I'm not sure what version of the menu module I'm using, I attached a picture of what it looks like below

Screen shot 2012-04-30 at 4.30.12 PM.png

I entered _blank in the target frame field for the menu item that I want to open in a new window and it shows as saved. How do I update the Version 2 menu?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 30, 2012 Apr 30, 2012

Copy link to clipboard

Copied

Hey, I mean in terms of your HTML Templates.

I am guessing your not using that at all and its manually entered into the html.

If you do not see something along the lines of {module_menu} but just html with a <div id="nav">and a ul li element with menu items in it then its just static.

You would have to update the templates with the correct menu module tag which has the right ID for the menu and then you would need to update the CSS and javascript too so it all works.

If it turns out the module is in there but has a bit like version="2" I can then show you what you need to update there.

Have a look in your templates around where the menu is in the HTML, what do you see?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 01, 2012 May 01, 2012

Copy link to clipboard

Copied

I looked into the html of my page template and here's what I found:

<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal helvetica; color: #777777;"><span style="line-height: 12px; font-family: helvetica, arial, sans-serif; color: #000000;">{module_menu, version="2", menuId="906940", moduleTemplateGroup="Default"}</span></p>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 13, 2013 May 13, 2013

Copy link to clipboard

Copied

I know this is old, but in case someone else needs to know how to fix this...

In the "Develop" tab or FTP, navigate to:
- ModuleTemplates
   - Menu
      - Default
         - childitem.html


and add this to the <a> tag:

target="{tag_menuitemtargetframe}"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 12, 2013 Sep 12, 2013

Copy link to clipboard

Copied

Very helpful fix to this bug!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 12, 2013 Sep 12, 2013

Copy link to clipboard

Copied

No bug. That is not valid XHTML so if you use the V2 menu option you choose to include it or not.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 23, 2014 Nov 23, 2014

Copy link to clipboard

Copied

Thanks! This helped me a lot.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 05, 2015 Feb 05, 2015

Copy link to clipboard

Copied

Thanks psteil,

It works

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 30, 2015 Apr 30, 2015

Copy link to clipboard

Copied

psteil,

This is what my code looks like:

<li {tag_menuitemidname_withid} {tag_menuitemcssclass_withclass}><a href="{tag_menuitemurl}">{tag_menuitemlabel}</a>{tag_menugroup}</li>

Can you explain where exactly the target="{tag_menuitemtargetframe}" should be inserted? I tried and couldn't get it to work.

Thank you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 22, 2015 May 22, 2015

Copy link to clipboard

Copied

Just thought I'd share our childitem.html so you can see where to put the target="{tag_menuitemtargetframe}" which needs to be placed within the <a> tag. Hope this helps T Kellen :]

<li {tag_menuitemidname_withid} {tag_menuitemcssclass_withclass}><a href="{tag_menuitemurl}" target="{tag_menuitemtargetframe}">{tag_menuitemlabel}</a><ul class="dropdown">{tag_menugroup}</ul></li>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 14, 2015 Nov 14, 2015

Copy link to clipboard

Copied

that code screwed up my entire menu

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 22, 2015 May 22, 2015

Copy link to clipboard

Copied

Great fix PSteil - thanks very much :]

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 28, 2016 Jun 28, 2016

Copy link to clipboard

Copied

Thank you! I always forget the fix and glad you posted it here!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 28, 2016 Jun 28, 2016

Copy link to clipboard

Copied

LATEST

Things are very different these days as you have liquid markup, none of the issues or limitations in this thread apply any more. This thread is from 2012.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines