How/Where does SuiteCRM compile the scss files in a theme? - php

I'm currently working on setting up a custom admin page for a specific task I need to do and it requires some custom styling in the theme. I went to the themes/SuiteP/css folder and found admin.scss. After making a change, I had assumed that Suite would dynamically compile the asset since I am developer mode; however, that did not happen.
I decided to search the code for any place I could find that would deal with compiling those files to *.css, but found no such place.
My question involves inquiring as to where that compilation takes place and/or how it takes place. Right now it appears as if I have to manually compile those assets, which seems pointless because it is just an extra step I have to manually take, rendering using SCSS less useful in comparison with CSS.
Right now, my solution will probably have to be adding a CSS file that has nothing to do with whatever pipeline exists, but if I can leverage existing functionality, that would great.

Due to legacy issues with the SugarCRM framework, SuiteCRM loads style.css for current theme. The sass work for SuiteCRM is in a transitioning period. It is currently a manual process, but we hope to make it automated in the future.
We are using Sass as a way to allow developers to customise the SuiteP theme. I have a github project which provides a UI to generate the variables.scss for you. I am hoping that it will be accepted in a future release.
So in regards to your workflow you only need to care about the style.css.
If you want to contribute back to the SuiteCRM project, then you will need to use the sass files in themes/SuiteP/css/.
However, if this is just for your instance of SuiteCRM, then you will want to create a style.css in the custom/themes/SuiteP/css/style.css. How you change that is up to you.
I would recommend that you use Sass to generate the style.css.
You can achieve this by copying the style.scss file custom/themes/SuiteP/css and then add the following to the file
#import ../../../../themes/SuiteP/css/style.scss
Note: I may have the path slightly wrong
or use the command line tools to include the themes/SuiteP/css/ directory
See for details:
SASS: Import a file from a different directory?
SuiteCRM should pick up the rest of the work. There is a change in SuiteCRM 7.9 that deprecates the $sugarcrm_version in favour of $suitecrm_version. This will effect theme themedef.php.
See for details
https://github.com/salesagility/SuiteCRM/pull/3233/files
I hope this answers your question.

Related

How to properly install/use LESS in CodeIgniter

My original problem was linking multiple stylesheet frameworks. My primary option was Materialize and for reasons, i'd like to integrate Bootstrap on some buttons and other components. After hours of desperate research, i found myself staring at css pre-processors, e.g. LESS and SASS. I found out that you can do dynamic css using these badasses.
Investing a couple more hours deciding which to use, I ended up failing to install both.
So far I managed to download bootstrap sass and integrated it inside my project and compiled it using grunt (follow this instruction). I don't know how to use it and where to start.
I found some cool references here but it was not enough to get me going.
.bootstrap {
#import "/bootstrap.less"
}
I have so my follow up questions to the post:
should I link the less file on my index.php?
can I use any editor and compile the less with any less compiler?
should i link the compiled less or the created css?
do I even need to use LESS for this?
Note: I'm a total newbie with LESS and SASS. Any information is a ++.
I personally prefer Sass and I use it a lot even for small CSS stylesheets!
Here you are my answer:
Absolutely not! A less file is not intended for browser parsing. It is intended only for development purpose, that is to produce one or more .css file.
Feel free to use any editor you prefer and compile with any compiler you prefer. For example, I use Scout-App for Sass.
You must link only .css produced files.
It depends on your project and/or your needs. LESS and Sass are very similar.
Other tips for you:
Install on your CodeIgniter app an asset helper, and in asset folder place your css and less files. See the directory structure below:
application
system
user_guide
assets
--css
--less
--js
--img
ecc...
Put your less file separated from your css file. Link css file with the asset helper and you will have autoupdatable style!
If you use Git, remember to ignore css folder and track less or sass folder.
I hope you can find these tips helpful!
UPDATE: It's a shame that no one answer to this question in time!

Why use Phalcon's Assets Manager to apply Filters?

I'm creating an app in Phalcon which contains a theme manager. A theme is nothing more that a collection of .scss and .volt files. Naturally, these .scss are built before being used.
I'm been testing Phalcon's assets manager. Apart from some difficulties creating custom filters, etc, I started wondering: why would someone build their files all the time? This would make each request much slower. Does Phalcon cache these assets?
Furthermore, when developing themes or doing a lot of frontend work it is useful to watch the source sass files for changes. Is this possible in Phalcon?
According to manual using ->setTargetPath() on assets collection makes it possible to save all selected files into one location. If you have some scripts you always include to your page, you can marge them to one file, and meantime minify thanks to filters filters. Code snipped would be somewhat like that:
$controller->assets->collection('jsGlobal')
->addJs('libs/jquery.js', true)
->addJs('libs/jquery-ui.js', true)
->setTargetPath('js/global.js')
->setTargetUri('js/global.js')
->join(true)
->addFilter(new \Phalcon\Assets\Filters\Jsmin());
You may want to check if script it already built under that js/global.js location to prevent from building it over and over again on production. This way, when making your deploy script you can just implement deletion of certain files on your production server.
Projects I'm working on uses less. We installed \lessc library to manage to keep in repository only .less files.
And again, in development mode we're not even checking if file was changed - we assume is was and are recompiling it just always. For production purposes, PHP is written to check if certain scripts does exist and is compiling .less only if they dont.

How to go about allowing plugins for a custom framework?

First off, this isn't really a programming question but more of a programming concept question. Basically, I've built a bespoke PHP framework to speed up deployment on my end and I want some kind of plugin system in place that will allow me to add specific features to the base of the framework (like the SQL class or maybe a Twitter package) that will allow me to throw them into a folder and not have to actually edit the base for every new project.
Any ideas of the best way of going about this?
Here is a nicely written post by #ircmaxell on how to do that and what are the options:
Handling Plugins In PHP
Also check out:
Best way to allow plugins for a PHP application
what im doing in my cms:
for each plugin i make a folder latin-named of this plugin's name.
i create a /translations folder in there too. Check here.
have a single php file that has 2 basic functions, the plugin_install and plugin_uninstall (you know, things to happen on install/unistall like tables creation/drop)
create a special page of your system that reads these plugins, installed and not and give an on/off switch so users can install/unistall them.
load these single files mentioned above by a single call to include_once on top of your index page (or administration page) so to include whatever functionality they offer.
enabled plugins will be loaded (include_once) from your main page, and also their functionality, so each plugin can call each other's as well.

Edit system extensions in TYPO3

I am using the felogin system extensions. Those extensions are part of the default TYPO3 installation and they are stored in typo3/sysext. I know that I can edit them by editing its code directly but I guess it is not the best way of doing it.
How can I "overwrite" those extensions without changing their code?
Shall I create a new custom plugin and copy & paste code of a system plugin I wish to alter?
You could just modify the extension and place a copy in typo3conf/ext/. This directory (so called "local extensions") override the system extensions.
However, you will probably run into trouble when you want to upgrade TYPO3.
Did you find a bug, if so, please report it. If you know, how to fix, then it would be great, if you would push the change into the review system
If you just want to change functionality, modifying existing code is not a really could solution. There's the concept of hooks (which is a clean one) and of XLCASSes, which is somehow dirty (as it can also cause trouble with newer TYPO3 versions). So basically the same as with every other extension.
Steffen

Magento - Custom Products Ordered Report - How to Extend using "local" code pool?

I am trying to customize the Products Ordered report so that it only shows a summary of the products that have an SKU starting with XX. I have been following the tutorial at http://magentocoder.jigneshpatel.co.in/reports/create-custom-reports-in-magento-admin/ to extend the module, but this tutorial shows how to extend the report by adding code to the "core" code pool, which will cause problems further down the road. I have been unable to get the modifications to work using the "local" code pool, because of the confusing nature of the Magento configuration files...
Has anyone successfully extended this (or a similar) report by making the modifications in the "local" code pool? There doesn't seem to be much in terms of documentation or tutorials surrounding this topic, which I find surprising.
Any help is greatly appreciated.
The simplest way is to copy the folder/file structure from /core downwards and recreate the bit you want inside /local - so app/code/local/Mage/Adminhtml/Block ... etc.
This works for PHP files, the local folder comes first in the include path so files there will be preferred over core, but I'm not sure about the config.xml...I think it would be fine though (you'd need the whole file, with your additions, as it won't read the core version at all).
This will leave core files intact, but if the files you've copied change in an update you'll need to take those changes and put them in your version.
Doing it as a standalone module would be possible, but is a bit hard to explain in an answer...the AW_Blog module is a good one to look at for working out what the config files do though.

Categories