Search code examples
content-management-systemcontao

How to install extensions in contao 4.4


I installed contao 4.4 in my localhost successfully.After successful installation I tried to install an extension via contao manager.Unfortunately it fails with console error.So I download zip file of extenson from codefog

and put it in the folder root/system/modules .But the extension is not found in backend.I think the extension is not installed successfully. How to make it works? Please help me.


Solution

  • This is how i install extensions in my contao 4 standard-edition. As commented, this only applies to the standard-edition, not the managed-edition. If you don't want to change to the standard-edition, you may better wait, until they fix the problem in the contao manager... Otherwise this is how it works:

    Installing a Contao 4 bundle

    Info: A bundle is the best thing you can find for extending contao.
    It is the cleanest way of adding functionality to the contao cms.

    1. Find the module on https://packagist.org/
    2. Get the "require ..." command from under the title
    3. Connect to your hosting (or if local, open cmd or terminal)
    4. Change to the root of your hosting
    5. Execute the require ... command for this extension

      composer require madeyourday/contao-rocksolid-columns

    6. Add the module to AppKernel (File: app/AppKernel.php)

    7. In the "$bundles" array we can now add our bundle to the list of bundles, that contao should load: (the bundle name used in this line can be found in vendor/%developer%/%extension%/src/ and then there is a ...Bundle... php File there, that tells you the name of the bundle)

      new MadeYourDay\RockSolidColumns\RockSolidColumnsBundle(),

    8. Open the installtool of contao (contao/install) and update the database

    Installing a Contao 4 extension

    Info: A contao 4 extension is defined by it's developer, it is actually still the same method of programming like in 3.5 but someone has tested it in contao 4 and approved of its functionality. This is the second best thing you can find for extending contao.

    1. Find the module on https://packagist.org/
    2. Get the "require ..." command from under the title
    3. Connect to your hosting (or if local, open cmd or terminal)
    4. Change to the root of your hosting
    5. Execute the require command for this extension

      composer require heimrichhannot/dlh_googlemaps

    6. Add the module to AppKernel (File: app/AppKernel.php)

    7. In the "$bundles" array we can now add our extension to the list of extensions, that contao should load:

      new ContaoModuleBundle('dlh_googlemaps', $this->getRootDir()),

    8. Open the installtool of contao (contao/install) and update the database

    Installing a Contao 3.5 extension

    Info: A contao 3.5 extension is your last hope, it is the same code as in contao 3.5 may or may not work - you have to test it yourself.

    1. Find the module on github (or some other repo)
    2. Conntect to your hosting with ssh (or if local, just open cmd or terminal)
    3. Change into "system/modules"
    4. Download the repo (e.g. git clone https://github.com/ContaoBlackForest/contao-system-notification system-notification) - notice the added "system-notification" at the end, that should be the foldername, in which the extions has to be (you can find the folder in the composer.json file inside the extension under "Resources/contao")
    5. Create syslinks (bin/console contao:symlinks)
    6. Add the module to AppKernel (File: app/AppKernel.php)
    7. This line should be added once, just after "use Symfony\Component\HttpKernel\Kernel;" (this only has to be added once and only if you are using contao 3.5 extensions)

      use Contao\CoreBundle\HttpKernel\Bundle\ContaoModuleBundle;

    8. In the "$bundles" array we can now add our extension to the list of extensions, that contao should load:

      new ContaoModuleBundle('system-notification', $this->getRootDir()),

    9. Open the installtool of contao (contao/install) and update the database

    Your Question
    To awnser your question, as the module you want to install, is a contao 4 extension, you could use the according instructions from above.

    contao 4 extension - https://packagist.org/packages/codefog/contao-news_categories