Page 1 of 1

topbar.xhtml profile anchor href attribute not working

Posted: 30 Apr 2018, 22:51
by bikrambarua

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

Re: topbar.xhtml profile anchor href attribute not working

Posted: 02 May 2018, 08:04
by kubrasulukan
We'll check and get back to you.

Best Regards,

Re: topbar.xhtml profile anchor href attribute not working

Posted: 11 Aug 2018, 12:14
by trumpP
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.

Re: topbar.xhtml profile anchor href attribute not working

Posted: 13 Aug 2018, 09:24
by aragorn
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();
        });

Re: topbar.xhtml profile anchor href attribute not working

Posted: 29 Aug 2018, 12:34
by trumpP
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.

Re: topbar.xhtml profile anchor href attribute not working

Posted: 07 Sep 2018, 08:27
by aragorn
Thanks ;)