#413 ✓resolved
Tiago Franco

<a> not supporting attribute 'target'

Reported by Tiago Franco | April 28th, 2009 @ 01:17 PM | in Hobo 1.0 - Final

The <a> tag is not supporting the 'target' attribute.

As a consequence, it is not possible to create a <nav-item> that opens in a new page out-of-the-shelf.

Please add 'target' support to the <a> attribute.

Comments and changes to this ticket

  • Bryan Larsen

    Bryan Larsen May 1st, 2009 @ 01:54 PM

    Hey, tiago, I think the markdownifying messed up your bug report. Could you please backquote appropritely and resend? Thanks.

  • Tiago Franco

    Tiago Franco May 4th, 2009 @ 03:18 PM

    Hi,

    Ups. I really need to get used to this markdown thing :)

    Here is my attempt to translate the original post.

    The &lta> tag is not supporting the 'target' attribute.

    As a consequence, it is not possible to create a <nav-item> that opens in a new page out-of-the-shelf.

    Please add 'target' support to the &lta> attribute.

  • Tiago Franco

    Tiago Franco May 4th, 2009 @ 03:20 PM

    Another attempt... a preview button could be useful here :)

    The <a> tag is not supporting the 'target' attribute.

    As a consequence, it is not possible to create a <nav-item> that opens in a new page out-of-the-shelf.

    Please add 'target' support to the <a> attribute.

  • Bryan Larsen

    Bryan Larsen May 4th, 2009 @ 04:03 PM

    OK, I didn't miss anything. I didn't think I did, but I thought it didn't hurt to ask before I started looking into it. In the future, quote using the backquote like this: <a>. That'll make your life easier!

  • Bryan Larsen

    Bryan Larsen May 12th, 2009 @ 06:53 PM

    • Assigned user set to “Bryan Larsen”
    • Tag changed from rapid, rapid-navigation to clean-up, rapid, rapid-navigation
    • State changed from “new” to “open”
    • Milestone set to Hobo 1.0 - Final

    Hey, tiago, I think the markdownifying messed up your bug report. Could you please backquote appropritely and resend? Thanks.

  • Bryan Larsen

    Bryan Larsen May 20th, 2009 @ 12:42 AM

    'a' does support the attribute target. All unnamed attributes are passed through.

    Perhaps what you want is the nav-item to pass the target attribute through to the a. Currently it passes attrs_for(:a) to a and everything else to the enclosing li.

    For example, we could do something like this:

    diff --git a/hobo/taglibs/rapid_navigation.dryml b/hobo/taglibs/rapid_navigation.dryml
    index b3fda26..86e6faf 100644
    --- a/hobo/taglibs/rapid_navigation.dryml
    +++ b/hobo/taglibs/rapid_navigation.dryml
    @@ -41,8 +41,8 @@ Then in your pages you can call the tag like this
       <% body = parameters.default 
          body = h(this.to_s) if body.blank? -%>
       <li class="#{'current' if (c = scope.current_navigation) && c.downcase == body.downcase.gsub
    -      merge-attrs="&attributes - attrs_for(:a)">
    -    <a merge-attrs="&attributes & attrs_for(:a)"><%= body %></a>
    +      merge-attrs="&attributes - (attrs_for(:a)+['target'])">
    +    <a merge-attrs="&attributes & (attrs_for(:a)+['target'])"><%= body %></a>
       </li>
     </def>
    

    Tom, any thoughts?

  • Tom Locke

    Tom Locke May 20th, 2009 @ 10:11 AM

    Yes that seems like a reasonable change

  • Tiago Franco

    Tiago Franco May 20th, 2009 @ 10:39 AM

    Byan,

    You are correct, the <a> link is now accepting the target attribute. I think that this wasn't the behavior when I opened the ticket. Am I wrong?

    Nevertheless, the change you suggest may seem reasonable, if one wants to create a nav where all items open in a new window (i.e. partners navigation menu).

    Thanks,
    Tiago Franco

  • Bryan Larsen

    Bryan Larsen November 26th, 2009 @ 08:40 PM

    • State changed from “open” to “resolved”

    resolved on May 20

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages