0

I am using Flask-Bootrsap/ Flask-Nav support to generate a navbar for my webapp. I have some issues trying to style it. I would like to add bootrsap or font/awesome icons but i don't know how to do it directly from my rendered.

Nav.py

@nav.navigation()
def mynavbar():
    return Navbar(
        'mysite',
        View('View Historic', 'Link1'),
        View('New users', 'Link2'),
        View('New users', 'Link3'),
        View('Upload file', 'Link4'),
        View('Packages', 'Link5'),
    )

Base.html

{% block navbar %}
    {{nav.mynavbar.render()}}
{% endblock %}
Ana
  • 167
  • 3
  • 17
  • Wouldn't it be easier to just return render_template('base.html') and do all the styling in the HTML file? At that point you can basically copy/paste from the bootstrap examples and it works great! – BrettJ Oct 02 '17 at 16:43

1 Answers1

0

Currently there isn't a way through the main branch.

See: https://github.com/mbr/flask-nav/pull/5 https://github.com/mbr/flask-bootstrap/pull/125

Someone made a branch for both Flask-Nav and Flask-Bootstrap to embed an img tag in the View link.

However, for some reason, the owner has yet to merge the pull request; his cited excuses seem asinine imo.

I'd recommend either using: https://github.com/nypgand1/flask-nav/tree/feature-ViewImg

or making equivalent modifications for your own usage as the owner seems to not care.

  • 1
    Whilst this may theoretically answer the question, [it would be preferable](//meta.stackoverflow.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. See [here](https://meta.stackexchange.com/a/94027/285661) for instructions how to write *better* "link-based" answers. Thanks! – GhostCat Dec 04 '17 at 19:46