[SOLVED] use Bootstrap 3 / 4 in a custom component

4 years 7 months ago - 4 years 7 months ago #313507 by samw
Hello,

I'm using CB's Flexistrap template, and have built the scaffolding/starting point of a custom component with Component Creator. I think I saw somewhere that CB uses Bootstrap 3 or 4, while the Joomla core is still using Bootstrap 2. In my custom component I'm overriding and creating alternative views, and I was wondering if there's any way to draw on CB's use of Bootstrap 3 or 4 when doing that. Component Creator's default views use tables and for responsiveness I'd like to just wrap some of them in a <div class="table-responsive"> instead of redesigning the view with divs, etc. -- but I tried it and it doesn't work. Is there any way to draw on CB's use of Bootstrap 3/4 to make that work?

Thanks,

Sam

Please Log in to join the conversation.

4 years 7 months ago #313509 by krileon
Replied by krileon on topic use Bootstrap 3 / 4 in a custom component
CB uses Bootstrap 4. We've no-conflict CSS implemented to avoid conflicts caused by B2 and B3 so there shouldn't be any problems. CBs CSS is also namespaced. This means CBs CSS can not impact anything outside of it self. To allow CBs CSS to style something that something needs to be surrounded by a div or span with the class "cb_template" on it. In addition to that CBs CSS needs to be loaded, which you can force to be loaded with CB Content Module on every page if you wanted or ensure CB login module is present on every page.

So with that said for your usage assuming CBs CSS is loaded you'd have something like the following.

<div class="cb_template">
    <div class="table-responsive">
        ....
    </div>
</div>


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: samw

Please Log in to join the conversation.

4 years 7 months ago #313511 by samw
Kyle,

Thank you so much. I already have the CB Login module on every page, and the extra div referencing the namespace works like a charm and saved bunches of time.

Sam
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 1.427 seconds

Facebook Twitter LinkedIn