8 Replies Latest reply: Sep 12, 2013 3:01 PM by Liam Dilley RSS

    Target attribute in BC Dynamic menus?

    mario_gudelj CommunityMVP

      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.

        • 1. Re: Target attribute in BC Dynamic menus?
          leilanim14

          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"

          • 2. Re: Target attribute in BC Dynamic menus?
            Liam Dilley CommunityMVP

            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.

            • 3. Re: Target attribute in BC Dynamic menus?
              leilanim14 Community Member

              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?

              • 4. Re: Target attribute in BC Dynamic menus?
                Liam Dilley CommunityMVP

                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?

                • 5. Re: Target attribute in BC Dynamic menus?
                  leilanim14 Community Member

                  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>

                  • 6. Re: Target attribute in BC Dynamic menus?
                    psteil Community Member

                    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}"

                    • 7. Re: Target attribute in BC Dynamic menus?
                      tallorder49 Community Member

                      Very helpful fix to this bug!

                      • 8. Re: Target attribute in BC Dynamic menus?
                        Liam Dilley CommunityMVP

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