? ? Success

User tests: Successful: Unsuccessful:

avatar bertmert
bertmert
15 Sep 2015

Even if Joomla core still uses Bootstrap 2 there are more and more Bootstrap 3 templates for Joomla.
It's easy to "translate" grid classes span1 to span12 with LESS to work with Bootstrap 3 (where they don't exist anymore) but needs knowledge and is too much for "normal" users.

So, the idea of this PR is to establish a new Advanced option bootstrap_class in module settings that makes it possible to select span for BS2 or several other classes used with BS3.

  • Create new module of type Custom Html.
  • Title: Bootstrap class
  • Select a position of your template (e.g. Protostar: banner)
  • Menu Assignment: On all pages
  • Tab Advanced: Select Bootstrap Size: 6
  • Tab Advanced: Select Module Style: html5 or xhtml

Go to frontend. (Looks a bit weird. Just because position banner is not inside a .row-fluid.)

See HTML source code of module (has a BS2 class span6):

<div class="moduletable span6">
 <h3>Bootstrap class</h3>
 <div class="custom"  >
 </div>
</div>
  • Apply PR
  • Reload frontend. See HTML source code (nothing has changed, BC)
  • Reload module settings page in backend. You see a new option "Bootstrap class", set by default to "span" (BC).
  • Save module.
  • Reload frontend. See HTML source code (nothing has changed, BC)
  • Select a BS3 class in field "Bootstrap class" (e.g. col-sm-).
  • Save module.
  • Reload frontend. See HTML source code of module (has a BS3 class col-sm-6 now)
<div class="moduletable col-sm-6">
 <h3>Bootstrap class</h3>
 <div class="custom"  >
 </div>
</div>
avatar bertmert bertmert - open - 15 Sep 2015
avatar bertmert bertmert - change - 15 Sep 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Sep 2015
Labels Added: ? ?
avatar Bakual
Bakual - comment - 15 Sep 2015

I don't think adding template specific parameters to modules is a good approach. Especially since that parameter is useless for all non-BS3 templates (and chromes which don't support it). It will confuse users more than it helps.

A better approach would be to allow the templates to define additional module chrome parameters which are then shown in an own tab in the module form. However that could be a UX nightmare because the options would depend on the template/chrome in use.

avatar bertmert
bertmert - comment - 15 Sep 2015

But what's about the bootstrap size that already exists in module settings and the span that is set statically by core modChromes xhtml and html5 already. They are useless for all non-BS2 templates.

avatar Bakual
Bakual - comment - 15 Sep 2015

But what's about the bootstrap size that already exists in module settings and the span that is set statically by core modChromes xhtml and html5 already. They are useless for all non-BS2 templates.

That was a decision made long before my time. But I sure don't want to add parameters for any possible template framework into core. That's certainly a wrong approach.
The existing bootstrap size mainly is wrong named. Users don't understand the purpose anyway. It should be better named "width" or so. You can still use this in your own template chromes. Obviously the system chromes will not work, but the template ones will work just fine with that parameter. You just would have a hardcoded (or coming from a template parameter) prefix.

As said, best would be if the template would add additional parameters to the module edit form. I guess that should actually be possible using a system plugin, but I haven't tried that. It would be the best and most flexible approach.

avatar bertmert bertmert - change - 16 Sep 2015
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2015-09-16 02:34:16
Closed_By bertmert

Add a Comment

Login with GitHub to post a comment