[imp] Add the ability to use a custom.css with Protostar.#4211
[imp] Add the ability to use a custom.css with Protostar.#4211roland-d wants to merge 4 commits intojoomla:stagingfrom
Conversation
|
A similar PR is open for the backend here: #3709 Personally I don't like using a custom.css and would rather use a plugin/module to do the same. There are many already existing which do exactly that and more. |
|
I am a fan of this approach On 3 September 2014 11:20, Thomas Hunziker notifications@github.com wrote:
Brian Teeman |
|
Reopening because the other PR is backend and this one is frontend. 😄 |
|
I think we should do the file_exists check with the full path: JPATH_SITE . "/templates/protostar/css/custom.css" |
|
In that case all references to $this->template should be removed. How about that? |
|
Sorry I sent it from my smartphone. I mean: file_exists(JPATH_SITE . '/templates/' . $this->template . '/css/custom.css')Otherwise I think we can have problems with sites outside the root www. |
|
I agree @phproberto Change has been comitted. |
|
Tested. Seems to work ok before and after the last commit 💃 Good job Roland! |
|
Not sure this would be B/C as some may have created a specific custom.css for TinyMCE only. |
If I understand it correctly, the worst thing that could happen is that the custom.css file is loaded always, while it currently would be loaded only when an editor is loaded (like in a form). Also it would only be the case if someone uses the Protostar template. |
|
It could break the template easily as someone may need specific css just for Tiny, and this custom.css would override the template.css |
|
Example: |
|
But wouldn't that then break the template already currently when in a form with an editor? Or do you think they just don't care in that case but would if it spreads to the whole site? Is that a generic TinyMCE feature that it loads the custom.css file if present? |
|
You can't use Tiny specific tags in the custom.css? |
|
PLG_TINY_FIELD_CUSTOM_CSS_DESC="Optional CSS file that will override the standard editor.css file. Enter a file name to point to a file in the CSS folder of the default template (for example, templates/beez3/css/). Or enter a full URL path to the custom CSS file. If you enter a value in this field, this file will be used instead of the editor.css file." It is common to call that file custom.css is what I mean. default css if the template css has been changed to display "badge" black text on white background, the badge effect will not show in TinyMCE edit field. The custom.css will include a modified version (in that case the original css would fit) |
|
Thanks for the explanation. I now understand what you mean. |
|
Closing this as there seems to be no way around it nor any interest. |
|
This topic came up again at the local user group. So I am thinking is, if custom.css can't be used, what if we change the name to something else for example user.css? |
|
Is the only problem the name custom.css? |
|
From what I understand what @infograf768 wrote it is indeed the name custom.css that is the problem here. Can you confirm @infograf768 ? |
|
If thats the case then its an easy and useful addition |
|
Moving RTC thanks for testing. Can someone add the This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4211. |
|
Setting RTc - thanks This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4211. |
|
Why restrain this new feature to 3.5 ? |
Because according to SemVer, new features require a new minor version. So it will be 3.5. No big deal either 😄 |
|
Merged to |
[3.5] [imp] Add the ability to use a custom CSS file with beez3 & make the other similiar checks consistend see #4211
|
I prefer custom.css instead of user.css because in all documentation on the internet or in pdf docs there it is called custom.css. If you want to have properly documentation you must add this exception for the Protostar template in the documentation. |
No. If it works bevor the update it will work also after the update. (e.g. via Plugin) If you use a core hack to make this work without a template copy this gets reverted every update anyway ;) |
|
@haya1300 It is not possible to use the name custom.css because Tinymce will otherwise use the file and apply the CSS style to your editor window.
It doesn't have to be us. Joomla is a community, so you can do it as well. |
|
Am i correct that i only have to use/change the index.php to be able to use custom.css ? |
|
No it's going to be in Joomla 3.5 (you can look at the milestone on the right to see what version it will be in) - and it will not require any changes to index.php when it's introduced - you will just need to create your custom CSS file. |
|
ok great! |
|
You can use a custom.css with any template easily if you install my plugin On 2/13/2016 05:27, jjsjjs wrote:
|
|
Thanks a lot :) If works ok i will write a review on the extensions page. This would be also a good candidate as a standard item for Joomla ;) |
|
@jjsjjs let me go do that really fast.. idky its not correct. |
|
I am out of the office February 18th and 19th. If this is an emergency please call me at (209) 217-6400 and leave a voicemail if I don't answer, I will do my best to respond promptly. I will reply to all non-emergency requests on Monday February 22st. Thank you, |
|
@jjsjjs updated |
|
Thanks Bear! Great plug-in. Worked instantly, no hasle. I will write a review this week on the extensions page under the pseudoname idnib (haha it's the reverse of my daughter's name) |
|
Thanks... its been a long time since I updated it but it does everything On 2/21/2016 15:58, jjsjjs wrote:
|
|
Guys this isn't the place to be talking about 3rd party plugins ;) Please take it off this thread :) |
|
just close the ticket george On 2/22/2016 14:41, George Wilson wrote:
|
|
It's been closed since August ;) |
Currently it is impossible to use a custom.css file when using the Protostar template. A search on the net always ends up with a core hack of the index.php file, which could result in a problem when the index.php is being updated in a Joomla update.
This change checks if the file custom.css exists and if so, load it.