Pending

User tests: Successful: Unsuccessful:

avatar ITPrism
ITPrism
15 Feb 2019

Summary of Changes

Added a code that will reorder stylesheet links if you provide an option 'order' to the method addStyleSheet().
That will be useful if you would like to overwrite default template styles.

Testing Instructions

Include CSS file from your view and set option 'order'.
For example:
$this->document->addStyleSheet('../media/fixform.css', ['order' => 6]);

addstylesheet_order

I am going to attach the file fixform.css, if you would like to use it for test.

Result

Without option 'order'.
before

With option 'order'.
after

fixform.css
fixform.zip

avatar ITPrism ITPrism - open - 15 Feb 2019
avatar ITPrism ITPrism - change - 15 Feb 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Feb 2019
Category Libraries
avatar mbabker
mbabker - comment - 15 Feb 2019

Being blunt here, I feel like time is better invested on the web asset API instead of adding what I personally equate to a core supported hack to the API. If you really need this fine grained level of control of stylesheets you can already resort the _styleSheets property at the onBeforeCompileHead event without adding another attribute to it. Specifying "I should render in slot 4" should not be the approach registering items, the logic should be "I should render after my dependencies", which is what the web asset API aims to accomplish. Even if someone decided this was a good idea to incorporate, how does it deal with the fact that there are umpteen thousand assets floating around the ecosystem and how does it prioritize 38 things having an order of 1 (which results in no real change)?

avatar Fedik
Fedik - comment - 16 Feb 2019

as @mbabker already said, just use WebAsset,
there no Doc currently, but for now can use #23463 #22435 as reference

avatar ITPrism
ITPrism - comment - 16 Feb 2019

WebAsset is awesome feature!!! It's a wonderful solution for many of my issues. :)
Thank you very much!

avatar Quy Quy - change - 16 Feb 2019
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2019-02-16 18:21:12
Closed_By Quy
avatar joomla-cms-bot joomla-cms-bot - change - 16 Feb 2019
Closed_Date 2019-02-16 18:21:12 2019-02-16 18:21:13
Closed_By Quy joomla-cms-bot
avatar joomla-cms-bot
joomla-cms-bot - comment - 16 Feb 2019

Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/23912

avatar joomla-cms-bot joomla-cms-bot - close - 16 Feb 2019

Add a Comment

Login with GitHub to post a comment