Skip to content

Commit

Permalink
Merge pull request #52 from contao-themes-net/fix-multidomain-setup
Browse files Browse the repository at this point in the history
Fix paths for multi domain setup
  • Loading branch information
MDevster authored Aug 3, 2023
2 parents a1f6123 + 474e86f commit 828c102
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Types of changes
Security in case of vulnerabilities.
)

## [2.0.7](https://github.com/contao-themes-net/mate-theme-bundle/tree/2.0.7) – 2023-08-01

- [Fixed] Fix paths for multi domain setup

## [2.0.6](https://github.com/contao-themes-net/mate-theme-bundle/tree/2.0.6) – 2023-03-09

- [Fixed] warning in debug mode in slider template
Expand Down
2 changes: 1 addition & 1 deletion src/Module/OddThemeSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class OddThemeSetup extends \BackendModule
{
const VERSION = '2.0.6';
const VERSION = '2.0.7';

protected $strTemplate = 'be_oddtheme_setup';

Expand Down
19 changes: 15 additions & 4 deletions src/ThemeUtils.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace ContaoThemesNet\ThemeOddBundle;

use Contao\Combiner;
Expand All @@ -9,20 +11,29 @@

class ThemeUtils
{
public static function getRootDir() {
static $scssFolder = 'bundles/pdirthemeodd/scss/';

public static function getRootDir()
{
return System::getContainer()->getParameter('kernel.project_dir');
}

public static function getWebDir() {
public static function getWebDir()
{
return StringUtil::stripRootDir(System::getContainer()->getParameter('contao.web_dir'));
}

public static function getCombinedStylesheet() {
public static function getCombinedStylesheet($theme = null): string
{
// for multi domain setup
if (null !== $theme) {
self::$scssFolder = 'files/odd/scss/'.$theme.'/';
}

// add stylesheets
$combiner = new Combiner();
$combiner->add('bundles/pdirthemeodd/bootstrap/dist/css/bootstrap.min.css');
$combiner->add('bundles/pdirthemeodd/scss/odd.scss');
$combiner->add(self::$scssFolder.'odd.scss');

return $combiner->getCombinedFile();
}
Expand Down

0 comments on commit 828c102

Please sign in to comment.