Chamilo 2.1 - How to create new themes properly? - php

I am new to Chamilo 2.1, which is an open-source LMS.
I initially posted this question in the official chamilo support forum some days ago. But as long as nobody knew or cared to answer there, I'm reposting it here in hope that maybe someone could have knowledge on the matter, willing to share. [original post]
I would like to know if there is a 'proper' way to create a new theme in addition to the current ones (aqua, ruby).
What I've gathered from my search in their forums, nobody yet has attempted creating a new theme, but only modifying the basic one (aqua). That is, as they say, by altering the css inside aqua theme, and probably find the address of the header image and replace it with one of their choice with the same name.
Haven't tried yet the above, but, well it doesn't sound like the correct approach. Moreover, I would like to keep aqua theme, too, not to destroy it.
An idea I had, based on that thought, was duplicating the 'aqua' folder inside ./common/libraries/resources/ and renaming it to 'aqua2'. Though 'aqua2' was present and selectable in the administration settings panel as a choice (under aqua and ruby), when activating it, it didn't really work...
But trying to dig inside Chamilo 2.1 folders, I managed to find a file called 'theme_generator.php' under ./common/libraries/php/util/theme_generator. I saw it does a bunch of stuff creating folders, copying aqua theme files etc, but does it really do what I think it does? Is it called somewhere from inside the web interface? (i don't know any php by the way, i'm just doing css stuff).
I would appreciate any feedback or help on the matter. Thanks in advance

There is no theme manager yet in the already released versions of chamilo lcms connect (2.1 and 3.0) and afaik there isn't one planned for the next release either.
Chamilo lcms connect is a collection of packages, some have to be installed (the core) some are optional.
Every package handles its own themes, images, translations, etc. So if you want a new theme you indeed need to copy/rename all the aqua folders in all the packages you want to use.
In our production system we did do it like that but we did not copy/implement the CSS in most of those folders, we just provide the (empty) files and import the CSS from the aqua CSS files.
You do need to have both a CSS folder with the necessary CSS files and an image folder for your theme in every package you will use, or your theme will not work.
You will probably only have to change the CSS file in the common package since there the main colors and headers and footers are set.
I can imagine in the future there will be an automated script to do this for you but for the moment, ore maybe there will be a mechanisms to default to the aqua theme when files are not found, but for now developers are focusing on other things so you will have to figure it out for yourself.
chamilo lcms connect (2.1, 3.0) and chamilo lms (1.*) do not share any code and handle things differently.

There is no documentation (as far as I know) as to how to write a new theme. You might want to try the IRC channel during the week to get more attention, or write to dev at lists.chamilo.org (I'll approve your mail so you don't have to subscribe).
Just as a bit of additional info, Chamilo 1.8 and 2.1 are not the same product, they will be renamed Chamilo LMS and Chamilo Connect Core respectively. Both are managed by the Chamilo association, but two different teams are working on them (with obviously frequent communication).

I have not used Chamilo 2.1, but I am experienced in Chamilo 1.8.8.4. I have changed the theme by copying an already existing theme and changed it to my liking by modifying the css. There i can manipulate the colors. I changed the header-logo.png in the css/nameoftheme/images directory. Make sure that the image is not larger than 316 by 84 pixels, or the image will not show.

Related

WORDPRESS - Clone Website on a New Installation to Update It

We need to recreate our site from scratch. When I mean from scratch I mean we want to keep the same content (pages, articles, URLs and tons of media) and move it to a new WordPress installation with a different theme.
A brief background to try to understand what the underlying problem is. The current site (the one to be copied and transferred) is HUGE. It has more than 1500 pages and 3000 articles. It is currently running on an old version of WordPress and an outdated theme. We are deliberately not updating WordPress, theme and PHP so as not to risk crashing and being left without a site (this has already happened in the past with another installation).
What we have done is to create (on the same hosting) a new, updated installation of WordPress (on another directory). This will be the new and definitive one. Then – when all is said and done – we should use the name of the first installation (but this will be another issue to deal with at the end). We decided to operate in this way because we want everything to be done as safely as possible.
Some details:
Objective: SITE 1 -> SITE 2
SITE 1: Installation: domain.org/directory1 WordPress 5.2 PHP 7.1.33
Theme: Awaken
SITE 2: Installation: domain.org/directory2 WordPress 5.7.1 PHP
7.1.33 Theme: Divi Builder
At the moment, we have already installed the new theme in directory2 and created the home page that will host all the pages and articles from the old site. We are not interested in keeping the plugins. Our aim is for the new installation to be as “clean” as possible, without the risk of dragging around old problems.
What do you think is the correct way to proceed? Again, the most important thing is that the links are not changed (so that the URLs will still work once the change has been made; I mean: domain.org/directory1/perma/link/article-written-in-the past = domain.org/directory2/perma/link/article-written-in-the past
Could the export/import tool do this job? How should I proceed to make sure that I don’t affect the performance of the new site? Is it possible to carry out a test with a few pages to see if this can be done?
Thank you all!
The first step is to create a backup of the existing site. You can do this manually, you need all of the site files plus the database.
However, Duplicator is a great plugin that will create a backup package that includes everything for you. One thing to be aware of is the size of your site may cause issues for the plugin do to server load, but its the easiest method. There are other plugins as well to help with migration.
Once you have everything you can copy it to a new domaon like dev.website.com. The installer from Duplicator will help with the url updates, but its pretty easy to adjust in the config file and database options table. If you use relative urls most things wont be an issue, but a simple find and replace in the database will easy update any absolute urls.
Once you have made all your changes in dev you just reverse the process by writing over the live site and your set. This is safe beacuse you have a backup of the live site from step one in case you need to revert to the current state.

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

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.

New to WordPress - editing existing theme

Forgive me if this isn't the right environment to pose a question of this nature.
I've just been assigned a project to create a site in WordPress based off of a purchased theme of similar structure. This is my first time working with WP, so I'm a bit overwhelmed with where to start.
I'm used to only working through a text editor, but WP obviously has a dev portal online that formatting and content can be built through.
So far I only have my theme imported and activated on WP and the PSDs for the site-to-be.
Should I be doing my editing/formatting/content-building through this online portal? My text editor? A combination?
Thanks in advance for any knowledge you can shed or articles you share!
If you're talking about using the Appearance Editor, use extreme caution. If you mess up a .php file, you can blank your whole website:
Be very careful editing PHP files of your current theme. The editor does not make backup copies. If you introduce an error that crashes your site, you cannot use the editor to fix the problem.
I would strongly recommend that you only use your text editor, and upload your changes to your WP server. Also, make sure you have backups, so that you can revert to a working copy if something goes wrong.
One article that I found on the topic:
Editing your WordPress Site 101
Repeat with me: Never use the built-in WordPress file editor. I won't bore you with all the reasons the built-in editor is a bad idea, but here’s the #1 reason: If you get a white screen of death, there's no way to access your site via wp-admin anymore.
It's a bit of a paradigm shift moving from standard text editor web development into the world of WP. Here are some points to help you along:
You should download/install a plugin called Synchi. This will make the WordPress text editor much more robust. It also allows you the ability to access and modify the WP theme files directly thru the dashboard (Appearance > Editor).
You can use an external text editor and jump back and forth, but I find it easier to stay inside the WP dashboard once you have Synchi installed. I only use Visual Studio if I'm coding something more complex and I want to see Intellisense.
If you are going to be making major changes to your base WP theme, you should create a "Child Theme" and work off of that. http://codex.wordpress.org/Child_Themes
There are millions of articles on how to get started with WP, so I'll let you Bing/Google that. Just keep in mind there's a bit of a learning curve so just BE PATIENT - you'll figure it out quickly enough!
I have to agree with the above response - you should avoid using the Wordpress editor for modifying theme files. Use the editor for creating pages and posts, only.
If you truly need to understand Wordpress, you should begin by understanding how it works. Unlike a static html site, Wordpress is created by a combination of php files which create parts of the final page (displayed to the user). Understanding the basics of how wordpress loads files will really help you get started. (tons of resources online)
Find a good text editor (or a free code editor like NetBeans), then learn how to sftp or ssh into your webserver so that you can edit theme files in your code editor.
Once you have that figured out, and understand how Wordpress loads files, you can begin modifying the theme to your PSDs, or create a child theme and do the same.
The point made by the above poster is quite valid... if you miss a tag or some other php error causes a 'white screen of death', you'll not be able to load the wordpress editor (because it's broken) to fix it. Whereas with an sftp connection you can still modify the file, then push it back to the server and reaccess your admin editor.

ExpressionEngine source control via git

Im stuck with supporting some ExpressionEngine sites and I'm trying to check this CMS into source control.
I am failing since I cannot see a way to decouple the database from the templates and other structures. I'd like to be able to version control aspects in the CMS including content and channel creation as well as template creation and modification.
I'm not sure why you say that EE is a legacy system, they actually just pushed out their v2.8 a few days ago and have been updating the system for years.
If you're familiar with WordPress, the process really shouldn't be too different. You need to save templates as files and version control those along with system files. You're most likely not going to be version-controlling the database similar to the way you wouldn't be doing that with WordPress.
Simply turning to Google would probably give you hundreds of answers about how to do this but I'll leave you with what I consider to be the most definitive reading on the subject:
http://devot-ee.com/articles/item/version-control-for-expressionengine-using-git-part-1
Have you saved the templates as text files? Once you do that, you can then just backup the template folder. http://ellislab.com/expressionengine/user-guide/templates/templates_as_files.html

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