Note: I have already posted this question on [SE's drupal] but didnt got any positive response there so i am posting same question here again.
I want to organize non-core(modules that are not bundled with core) modules in Drupal 7. This is my proposed structure:
Contributed modules - downloaded modules that are untouched
Custom modules - downloaded modules that are modified to suit the requirement
local modules - self-developed modules
I GUESS, the best approach for this is to make three folders within sites/all/modules like below:
sites/all/modules/contrib
sites/all/modules/custom
sites/all/modules/local
Now, there are two ways to install a module:
Manually
From the admin panel
While installing the new module manually, everything is fine. I can just go to the directory and place the module there. But how to install a newly downloaded module in `sites/all/modules/contrib from admin-panel. Moreover, is there any better approach for organizing non-core modules?
Finally after banging head on google for hours, asking question on SO and SE's drupal and communicating with other users via comments, I cracked it...
Well, the directory structure is still debatable but satisfactory for me. But the answer to the most imp question is "DRUSH".
Refer this and this node from Drupal. Collectively, it has everything needed to answer my entire question.
I would also like to point you to this answer which has provided the first and most-imp hint to me.
Related
I have been trying to understand how this concept works. Adding or removing code modules from laravel project. I have seen this feature in many places such as quickadminpanel.com, October CMS etc. These sites are used to create an admin panel quicker, there is an interesting feature that i found in quickadminpanel that is installing module that i need. Basically i want to achieve this but i don't know how to do !! May be someone can help as this feature and concept actually exists.
The author himself replied in a mail. Now the concept is much clear to me. He simply replied this, "It's similar to how Laravel works with stubs - copy-pasting files as templates, replacing the variables in content: youtube.com/watch?v=eWarTZuates&t=1s"
I'm wondering what the best way (if there is a way) for an application to auto-discover [relevant] PHP "packages" installed by Composer.
My use case specific scenario:
I have a PHP app that includes my "framework" (for lack of a better word). This framework brings some basic functionality (routing, admin etc).
I'm slowly building in more advanced functionality, say, a blog module. This module is entirely self contained in it's own directory (but obviously has dependencies on the framework).
I'd like this blog module to be a self contained Composer package, so that I can selectively require the package in my app's root composer.json file.
Now, I need for the framework to know that it's there so that it can, for example, set the routing correctly and load up any admin functionality that the module requires.
What I've thought so far:
I'm relatively experienced in PHP, but "proper" OOP and autoloading is a little bit beyond my knowledge at the moment, so please forgive if there are inbuilt functions to do this. I don't even know what terms to Google!
I have thought I could maybe read the installed.json file which composer puts at vendor/composer/installed.php but I'm not sure how to set up my packages (e.g. blog) so they announce what they are. I'd like to future proof it so that I'm not looking for known module names (or regexing vendor or package names), but rather looking for packages to say "hey framework, I know you! You can use me!"
Maybe I can somehow instruct Composer (through the package's composer.json file) to stick in an arbitrary key/value pair in installed.json?
Any suggestions welcome, or directions as to what sort of Googling I should be doing.
Oh welcome to the world of managing dependencies on your framework.
I have some experience with auraphp, where we dealt with similar issue. You can read the blog post Composer-Assisted Two-Stage Configuration .
So what we finally ended-up adding https://github.com/auraphp/Aura.Web/blob/a3870d1a16ecd3ab6c4807165ac5196384da62cd/composer.json#L26-L36 these lines in the packages that need to understand to load by the framework.
You can also see how this bundle can also get autoloaded with the configurations.
in your composer.json
https://github.com/harikt/Aura.Asset_Bundle/blob/6ea787979390e69bf6ecb1e33ce00ed90f306e2f/composer.json#L21-L27
and the config/Common.php ( https://github.com/harikt/Aura.Asset_Bundle/blob/223126cedb460e486c4f0b242719c96c14be5385/config/Common.php ) , note we have other development modes also. For a detailed look check https://github.com/auraphp/Aura.Web_Project or https://github.com/auraphp/Aura.Framework_Project
Hope that helps a bit to look into the code and work on your own solution.
I looking for some plugin structure for Laravel based applications.
For example a forum software, a cms or a e-commerce application can benefit from a plugin structure.
My question is what is the best way to implement this plugin system so that third party plugins can extend the application. The main issue is that it should be dynamically extendible and users should be able to install these plugins easily without messing with the app code.
This question also extends to themes but thats another question. Any ideas?
Laravel is a framework, not a CMS like Wordpress or Joomla, so plugin system that fits everybody may be quite hard to create as Laravel can be used in many ways, but I can really see the benefit of easy packages in some contexts.
The Packagist has been already mentioned and it doesn't solve directly your problem but how about:
Find good usable packages from Packagist for the purposes you need
Define common plugin architecture (common API for binding things together, installer, package format, migration, updates etc) on top of Packagist packages
Create installer that fetches packages via Packagist/Composer and adds sets sane default settings and configuration for the packages and integrates them into the defined plugin architecture
Document and plan this really well and the others will soon follow
I'm a little confused about the question, but I believe what you are looking for is already implemented in Laravel 4. They are just called Packages, and can be found at http://www.packagist.org and easily installed and autoloaded into your application using Composer.
I'm trying to do versioning with GIT and I'm trying to figure out the features module. The Drupal configuration has all its modules stored in the site that it belongs so.
Ex with Google Maps:
sites/theme/modules/googlemaps
But I've been saving the features in the default all directory. Ex:
sites/all/modules/googlemaps
Should the googlemaps feature and module be stored in the same path? I ask because I noticed certain things don't seem to be refelected when pushed and pulled.And is there a good tutorial on how to use features with git?
Drupal best practices encourage storing all non core modules in "sites/all/modules"
Only if you have a multi-site install and want to add a specific piece of code to one of the sites should you store something in "sites/sitename.com/modules".
As far as features go the modules directory doesn't care how you nest the modules as long as they are under the "sites/all/modules" directory. So you want to create 4 seperate directories to store your modules in:
"sites/all/modules/contrib" - this stores all downloaded community modules
"sites/all/modules/custom" - this stores your custom modules
"sites/all/modules/features" - this stores all of your generated features
"sites/all/modules/patched" - if for some reason you need to patch a contrib module drop it in here with the patch and some notes so you will know how to update the module later.
So to answer your question directly. You should store features inside the "sites/all/modules" directory.
Edit:
This question inspired me to write a blog post on my company blog to expound on the strategy above a little further. Check it out at clikfocus.com
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.