Skip to content

Commit

Permalink
Merge pull request #67 from contao-themes-net/feature/c4/multidomain
Browse files Browse the repository at this point in the history
multidomain support (contao 4)
  • Loading branch information
MDevster authored Dec 5, 2022
2 parents 45b5470 + 870fea0 commit 1566a08
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 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.
)

## [1.11.0](https://github.com/contao-themes-net/nature-theme-bundle/tree/1.11.0) – 2022-11-30

- [Added] Add multi domain support

## [1.10.0](https://github.com/contao-themes-net/nature-theme-bundle/tree/1.10.0) – 2022-10-25

- [Added] Add more options to style content slider
Expand Down
2 changes: 1 addition & 1 deletion src/Module/NatureThemeSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

class NatureThemeSetup extends BackendModule
{
public const VERSION = '1.10.0';
public const VERSION = '1.11.0';

protected $strTemplate = 'be_naturetheme_setup';

Expand Down
16 changes: 13 additions & 3 deletions src/ThemeUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

class ThemeUtils
{
public static string $themeFolder = 'bundles/contaothemesnetnaturetheme/';
public static string $scssFolder = 'scss/';

public static function getRootDir()
{
return System::getContainer()->getParameter('kernel.project_dir');
Expand All @@ -34,16 +37,23 @@ public static function getWebDir()
return StringUtil::stripRootDir(System::getContainer()->getParameter('contao.web_dir'));
}

public static function getCombinedStylesheet()
public static function getCombinedStylesheet($theme = null)
{
self::$scssFolder = self::$themeFolder.self::$scssFolder;

// for multi domain setup
if (null !== $theme) {
self::$scssFolder = 'files/naturetheme/scss/'.$theme.'/';
}

// add stylesheets
$combiner = new Combiner();
$combiner->add('bundles/contaothemesnetnaturetheme/fonts/fontawesome/css/all.min.css');

if ('WIN' === strtoupper(substr(PHP_OS, 0, 3))) {
$combiner->add('bundles/contaothemesnetnaturetheme/scss/nature_win.scss');
$combiner->add(self::$scssFolder.'nature_win.scss');
} else {
$combiner->add('bundles/contaothemesnetnaturetheme/scss/nature.scss');
$combiner->add(self::$scssFolder.'nature.scss');
}

return $combiner->getCombinedFile();
Expand Down

0 comments on commit 1566a08

Please sign in to comment.