topbar.xhtml profile anchor href attribute not working

Post Reply
bikrambarua
Posts: 15
Joined: 15 May 2013, 19:00

30 Apr 2018, 22:51

Code: Select all

<ul id="topbar-profile-menu">
                <li role="menuitem">
                    <a href="https://www.primefaces.org/">
                        <i class="topbar-icon fa fa-fw fa-paint-brush"></i>
                        <span class="topbar-item-name">Link</span>
                    </a>
                 </li>
            </ul>
The href attribute for list item is not working in topbar.xhtml under profile. Please try the attached code and let me know what's wrong with the code.
Its working for ultima and other templates

kubrasulukan
Posts: 87
Joined: 10 Jan 2018, 16:04

02 May 2018, 08:04

We'll check and get back to you.

Best Regards,

trumpP
Posts: 20
Joined: 11 Aug 2018, 11:20
Contact:

11 Aug 2018, 12:14

Example
Link to an email address with a specified subject (will only work if you have mail installed):

<a href="mailto:someone@example.com?Subject=Hello%20again">Send mail!</a>

The href attribute specifies the URL of the page the link goes to.

If the href attribute is not present, the <a> tag is not a hyperlink.

User avatar
aragorn
Posts: 3163
Joined: 29 Jun 2013, 12:38

13 Aug 2018, 09:24

Sorry for the delayed response. Fixed for next version. Please make the following changes in layout.js for now;

Code: Select all

//line 153
     this.profileMenuLinks.off('click').on('click', function (e) {
            var link = $(this);
            var item = link.parent();
            var submenu = item.children('ul');

            if(item.hasClass('menuitem-active')) {
                item.removeClass('menuitem-active');
                submenu.slideUp();
            }
            else {
                item.siblings('.menuitem-active').removeClass('menuitem-active').children('ul').slideUp();
                item.addClass('menuitem-active');
                submenu.slideDown();
            }
            
            /********************** ADD THESE LINES *********************/
                  var href = link.attr('href');
                  if(href && href !== '#') {
                      window.location.href = href;
                  }
            /***************************************************************/

            e.preventDefault();
        });

trumpP
Posts: 20
Joined: 11 Aug 2018, 11:20
Contact:

29 Aug 2018, 12:34

Give your anchor a class:

<a class="anchor" id="top"></a>
You can then position the anchor an offset higher or lower than where it actually appears on the page, by making it a block element and relatively positioning it. -250px will position the anchor up 250px

a.anchor {
display: block;
position: relative;
top: -250px;
visibility: hidden;
}
Get valid and updated HPE6-A42 ACMA V8 HP Exam Dumps from CertificationsSoul. We assure your success with our Aruba Certified Mobility Associate V8 HPE6-A42 Architect exam dumps. For more updates about Aruba Certified Mobility Associate V8 HPE6-A42 Exam.

User avatar
aragorn
Posts: 3163
Joined: 29 Jun 2013, 12:38

07 Sep 2018, 08:27

Thanks ;)

Post Reply

Return to “Harmony - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 0 guests