-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from pdir/news-categories-compatibility
Fix compatibility with Codefog News Categories bundle
- Loading branch information
Showing
6 changed files
with
70 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
Check failure on line 1 in src/Module/NewsCategoriesModule.php GitHub Actions / PHPStan
Check failure on line 1 in src/Module/NewsCategoriesModule.php GitHub Actions / PHPStan
|
||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* social feed bundle for Contao Open Source CMS | ||
* | ||
* Copyright (c) 2023 pdir / digital agentur // pdir GmbH | ||
* | ||
* @package social-feed-bundle | ||
* @link https://github.com/pdir/social-feed-bundle | ||
* @license http://www.gnu.org/licences/lgpl-3.0.html LGPL | ||
* @author Mathias Arzberger <[email protected]> | ||
* @author Philipp Seibt <[email protected]> | ||
* @author pdir GmbH <https://pdir.de> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Pdir\SocialFeedBundle\Module; | ||
|
||
use Codefog\NewsCategoriesBundle\FrontendModule\NewsListModule; | ||
use Contao\LayoutModel; | ||
|
||
class NewsCategoriesModule extends NewsListModule | ||
{ | ||
/** | ||
* Template. | ||
* | ||
* @var string | ||
*/ | ||
protected $strTemplate = 'mod_newslist'; | ||
|
||
protected function compile(): void | ||
{ | ||
parent::compile(); | ||
|
||
$this->Template->sfMasonry = $this->pdir_sf_enableMasonry; | ||
$this->Template->sfColumns = ' '.$this->pdir_sf_columns; | ||
|
||
// only used if the contao speed bundle is installed and the js_lazyload template is activated (https://github.com/heimrichhannot/contao-speed-bundle) | ||
$this->Template->lazyload = false; | ||
$layout = LayoutModel::findByPk($GLOBALS['objPage']->layout); | ||
|
||
if (null !== $layout->scripts && strpos($layout->scripts, 'lazyload')) { | ||
$this->Template->lazyload = true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters