Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap4 tabs not rendering properly #698

Closed
Sorjak opened this issue Mar 14, 2017 · 3 comments
Closed

Bootstrap4 tabs not rendering properly #698

Sorjak opened this issue Mar 14, 2017 · 3 comments

Comments

@Sorjak
Copy link

Sorjak commented Mar 14, 2017

  • Package version: 1.6.1
  • Django version: 1.10.3
  • Python version: 3.4.2

Description:

Trying to get tabs to render, using TabHolder and Tabs as documented.

TabHolder( 
    Tab('Header Block',
        InlineField('first_image_upload'),
        InlineField('first_video_upload'),
    ),
    Tab('Main Block',
        InlineField('second_image_upload'),
        InlineField('second_video_upload')
    ),
),

This results in the main tabs nav with <li> elements that have the "tab-pane" css class, where they should have the "nav-item" css class, and the <a> links under them should have the "nav-link" css class, according to this

This is the current result:

tabs-error

I've tried overriding the "tab-link.html" template under bootstrap4/layout, but it doesn't seem like there's a way to override the "link_template" field in the Tab object.

Am I missing something obvious?

@carltongibson
Copy link
Collaborator

Hi @Sorjak — Can you review #676? Does that help? (Tests were failing there so it needs updating at the least but, Is that your issue?)

@nyejon
Copy link

nyejon commented May 2, 2017

Hi,

I solved this on my side using the below edit to the template pack:

tab-link.html:
<li class="nav-item"><a class="nav-link{% if 'active' in link.css_class %} active{% endif %}" href="#{{ link.css_id }}" data-toggle="tab">{{ link.name|capfirst }}{% if tab.errors %}!{% endif %}</a></li>

@carltongibson
Copy link
Collaborator

See #732: I've asked for help finalising Bootstrap 4 support, and we'll do a new release in the autumn before Django 2.0, or sooner if we get lots of input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants