?
avatar adi8i
adi8i
22 Apr 2015

Steps to reproduce the issue

If you go to menu manager - a menu item - options - turn on show icons, so set all of then to show - then in single article view, the cog is not clickable, protostar will load bootstarp inside template, but if you use another theme, you can reproduce the issue.

Should add a line in com_content - views- article - tmpl - default.php
something like JHtml::_('bootstrap.framework');

you know better, please check it :smile:

Look like random loading, really. :P

avatar adi8i adi8i - open - 22 Apr 2015
avatar joomla-cms-bot joomla-cms-bot - change - 22 Apr 2015
Labels Added: ?
avatar brianteeman
brianteeman - comment - 22 Apr 2015

Surely this is an issue with your template


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6821.

avatar w00fz
w00fz - comment - 23 Apr 2015

@brianteeman The problem is that Joomla is in the assumption that every template uses the bootstrap.framework behavior when it's not always the case.
In protostar this is not an issue because protostar loads bootstrap upfront and so whenever there's something bootstrapy it just works (see https://github.com/joomla/joomla-cms/blob/staging/templates/protostar/index.php#L39).

For those templates trying to stay frameworks agnostic, it's all about relying on Joomla, but like pointed by @adi8i this is not always working. Single articles that have icons showing, for instance, render a gear-button that is entirely bootstrap dependent. Without bootstrap JS it doesn't allow in any way to open the dropdown.

So unless i'm missing something, this seems to me to be a Joomla issue. Bootstrap should be toggled on whenever needed by Joomla, exactly like it happens for other behaviors such as captions, highlights, and so on.

Note: This doesn't seem to be an issue with Category Blog, it is for Featured Article or Single Article

avatar mahagr
mahagr - comment - 23 Apr 2015

The first rule for mobile friendly site is to load only the assets that are required to load that page to save some bandwidth. If Joomla doesn't need bootstrap to make the page to load, it shouldn't load it. And yes, there are many pages even in Joomla sample data, which do not need all the javascript to be loaded (at least if you're a guest).

I if I remember it correctly the main goal for Joomla 3.5 will be on decoupling Joomla from Bootstrap 3.2 by moving rest of the HTML inside the classes into layouts or template files. I bet that the goal is to eventually move on to Bootstrap 3.3 or later. It would be nice if at that point Joomla would support also Bootstrap 3.2, which is fully possible -- but requires some extra thought.

In order to do that, Joomla does not only need to move html out of the code, but also to move any JHtml::_() call that loads javascript into the layouts and move the responsibility of loading the needed assets to the layout files themselves.

I know that the easy solution is to hardcode the template to load assets to protect itself against badly written extensions, but that said Joomla should lead the way and show the community how the extensions should be optimized starting from J!3.5.

This was just an beta experiment as we already knew that we cannot do it with 3rd party extensions, but I was a bit surprised we needed the same workaround with some Joomla views as well. That said many of the views already load bootstrap when they need it, so I bet that they are missing just because of the default template happens to load it by default.

In fact Joomla 3.4 is in many areas so much better than J! 3.3 that we decided to drop support from all the older versions. I'm really waiting for Joomla 3.5 as it will finally allow us to move forward from unsupported Bootstrap 2!

avatar BuddhiEash
BuddhiEash - comment - 12 May 2015

This issue not occurs on Joomla default template.It works fine.Sorry if i haven't posted the answer in a proper way because this is my first post on Joomla issue tracker.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6821.

avatar mahagr
mahagr - comment - 12 May 2015

The issue isn't there with Joomla default template as it always loads Bootstrap javascript -- try to remove that line from index.php and you will see that some parts of articles will stop working, while the rest correctly add the file they need.

avatar w00fz
w00fz - comment - 12 May 2015

See my comment above, I explained with links why this is no issue in protostar

avatar N6REJ
N6REJ - comment - 12 May 2015

@w00fz exactly which template are you talking about? A custom one? I don't think the issue is as much Bootstrap as it is the change from mootools to JQuery. Why don't you simply load JQ in your template?

avatar mahagr
mahagr - comment - 12 May 2015

We do load, though the issue isn't jQuery but bootstrap. But it would be better if Joomla loaded only the assets it needs to render the page and if all the components (and views) would require the assets they need.

We just wanted to test if Joomla 3.4 finally does the same what it has been doing in admin -- by not loading assets it won't need. Layouts should handle loading the assets as it's the only way to get rid of the hardcoded dependency to Mootools 1 -- err, Mootools 2 -- errr, Bootstrap 2.. errr.. Bootstrap 3.

avatar w00fz
w00fz - comment - 12 May 2015

We don't want to load jQuery nor MooTools, we are building a custom template and we do have our own set of assets that we wish to load. This is all fine until we use Joomla com_content that relies and expects Bootstrap JavaScript to be loaded.
Protostar, that is the default Joomla template, never faces this issue for the simple reason that the whole JS are loaded right in the index.php via framework behavior and so it's available for any component that needs it.
This is obviously an issue for whoever decides to go completely custom and only load assets when actually needed.

If I have a page that doesn't show any cog dropdown (which relies on bootstrap dropdowns), even if I loaded bootstrap it would serve no purpose at all, it would just be extra unnecessary load for the page.

On the other hand, if the Joomla core options for showing the icons gets enabled, then that template view should take care of loading the required assets it depends upon.

Forcing a template developer to load jQuery / Bootstrap just to workaround this issue is not acceptable.

avatar bertmert
bertmert - comment - 12 May 2015

I'm using/writing templates with and without Bootstrap with Joomla 3.
Use overrides! I think a template coder should know what this is and how to use them.
Remove JHtml lines that load JQuery or BS in these overrides!
Override JLayout layouts. Write your own.
Or manipulate header data. ($headdata = $this->getHeadData();)

Use

echo JHtml::_('icon.print_popup', $item, $params, array(), true);
echo JHtml::_('icon.email', $item, $params, array(), true);
...
and so on, without cogs/bootstrap classes (Have a look into Beez3).

or use your own JHtml class in your template.

avatar w00fz
w00fz - comment - 12 May 2015

That could work as a workaround but it's no solution to the problem.
Why should I override and keep the override in sync with every joomla update when the solution is just to add the bootstrap behavior call in the view or controller itself.
I have nothing to override in there, the output is just fine, the issue is that natively joomla is rendering a dropdown that depends on bootstrap and it doesn't load the bootstrap js.

// Djamil Legato // From iPhone //

On May 12, 2015, at 15:48, bertmert notifications@github.com wrote:

I'm using/writing templates with and without Bootstrap with Joomla 3.
Use overrides! I think a template coder should know what this is and how to use them.
Remove JHtml lines that load JQuery or BS in these overrides!
Override JLayout layouts. Write your own.
Or manipulate header data. ($headdata = $this->getHeadData();)

Use

echo JHtml::('icon.print_popup', $item, $params, array(), true);
echo JHtml::
('icon.email', $item, $params, array(), true);
...
and so on, without cogs/bootstrap classes (Have a look into Beez3).
or use your own JHtml class in your template.


Reply to this email directly or view it on GitHub.

avatar mbabker
mbabker - comment - 12 May 2015

Every layout should be calling the helper methods to load whatever media it needs. An assumption something else in the system is doing it is a bug. Period.

avatar w00fz
w00fz - comment - 12 May 2015

Thank you!

avatar bertmert
bertmert - comment - 13 May 2015

Sorry, complete misunderstanding from my side. I understood that you want to get rid of JQuery and BS in your templates at all.
So, nearly any layout needs a Bootstrap call. And whats about Bootstrap CSS for templates that do not load it or do not have it in their own CSS file. I still would prefer to add 2 lines in my template...

avatar mahagr
mahagr - comment - 13 May 2015

@mbabker Thank You!

I may be repeating myself, but...

For me the issue isn't even that I wanted to replace Bootstrap 2 right now, but to look into the future and allow Joomla to finally become independent of Bootstrap 2 -- if nothing else, just to be able to move to Bootstrap 3. Otherwise we are stuck on obsolete framework for years to come or we have the same nightmare we had with upgrading Joomla as with 2.5 -> 3.0 where the only way to move to the next version was to update every single template / CSS file in every single extension in use just to get it to work.

The only way to do that is to move all asset (JS/CSS) loading into the layout as well as make sure that every layout loads what it needs.

If I recall it right, goal of J3.5 was to separate all the hardcoded html into layout files. This issue should be part of the same goal or it won't work.

avatar bertmert
bertmert - comment - 16 May 2015

@adi8i
Please see and test PR #6961
Icons layout loads Bootstrap framework now (but only JS).

avatar zero-24
zero-24 - comment - 16 May 2015

Closing as we have a PR here: #6961 Thanks :smile:

avatar zero-24 zero-24 - change - 16 May 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-05-16 10:19:45
Closed_By zero-24
avatar zero-24 zero-24 - close - 16 May 2015
avatar zero-24 zero-24 - close - 16 May 2015
avatar bertmert
bertmert - comment - 16 May 2015

@adi8i
When you send stupid messages to me don't delete them here. "Look smart" to whom?
I said clearly "Sorry" #6821 (comment)
Why didn't you provide your own PR and closed here if you don't like discussions and don't like to here something about better alternatives than that PR?

avatar adi8i
adi8i - comment - 16 May 2015

@bertmert yea i have not seen your 'sorry', sorry, you can still read the message via email if is not here :laughing:

Your PR is ok, btw :P

Add a Comment

Login with GitHub to post a comment