Nyxynyx
Nyxynyx

Reputation: 63687

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

Upvotes: 10

Views: 8018

Answers (6)

ihafeez
ihafeez

Reputation: 11

<li>{{ loginButtons }}</li>

The problem here is you forget to use > "greater than sign", therefore it should be:

{{> loginButtons }}

Upvotes: 1

Vinay Vemula
Vinay Vemula

Reputation: 3995

Had the same problem because of useraccounts:bootstrap package conflicting with this package.

Remove all packages (can be achieved through meteor remove or by adding # in front of package name in .meteor/packages) and then enable packages one by one. You'll know the package causing conflict. Then remove the conflicting package using meteor remove {packagename}

Upvotes: 0

Anthony To
Anthony To

Reputation: 2303

I also accidentally had both the bootstrap and bootstrap 3 packages installed, which was breaking the css. I did $ meteor remove bootstrap and everything works now. Stupid mistake, but maybe it'll help someone.

Upvotes: 1

Danail Gabenski
Danail Gabenski

Reputation: 3670

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.

Upvotes: 9

Nathan
Nathan

Reputation: 470

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.

Upvotes: 1

netAction
netAction

Reputation: 1877

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

Upvotes: 3

Related Questions