Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor's accounts-ui-bootstrap-3 {{loginButtons}} not displaying

After installing bootstrap-3 and accounts-ui-bootstrap-3, the ui-accounts login widget did not appear when {{ loginButtons }} is used. Instead a <div> is found in its place but no widget is visible.

Are there additional steps that is missing for the widget to be displayed?

Adding Bootstrap 3 packages

mrt add bootstrap-3
mrt add accounts-ui-bootstrap-3

main.html

<body>
  {{> header}}
</body>

<template name="header">
    <div class="navbar navbar-fixed-top navbar-inverse" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#">My Bootstrap 3 App</a>
            </div>
            <div class="collapse navbar-collapse">
                <ul class="nav navbar-nav">
                    <li class="active"><a href="#">Home</a></li>
                    <li>{{ loginButtons }}</li>
                </ul>
            </div><!-- /.nav-collapse -->
        </div><!-- /.container -->
    </div>
</template>

Output of {{ loginButtons}}

<div id="login-buttons" class="login-buttons-dropdown-align-right"></div>

enter image description here


Update

Misaligned {{ loginButtons }}

enter image description here

Properly aligned example in docs

enter image description here

like image 938
Nyxynyx Avatar asked Nov 22 '13 19:11

Nyxynyx


3 Answers

To whoever finds this and wonders why this is happening, the solution is pretty simple. Just remove the standard accounts-ui package from meteor by typing meteor remove accounts-ui. Apparently the standard package overrides the CSS classes of the bootstrap-3 styled accounts ui.

like image 70
Danail Gabenski Avatar answered Oct 21 '22 17:10

Danail Gabenski


You have to leave out the LI element around {{loginButtons}}.

<div class="collapse navbar-collapse">
  <ul class="nav navbar-nav">
    <li class="active"><a href="#">Home</a></li>
    <li><a href="#about">About</a></li>
    {{loginButtons}}
  </ul>
</div><!--/.nav-collapse -->

Additionally, you need a package like accounts-facebook, accounts-password or accounts-google.

mrt add accounts-twitter
like image 39
netAction Avatar answered Oct 21 '22 19:10

netAction


If you inspect the element, you may notice:

#login-buttons {
    display: none;
}

This was the problem I had, although, I don't know why it is set to display: none.

like image 21
Nathan Avatar answered Oct 21 '22 19:10

Nathan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!