markocupic/gallery_creator

Contao开源CMS的画廊扩展

安装: 378

依赖: 0

建议: 0

安全: 0

星标: 6

关注者: 7

分支: 3

开放问题: 5

类型:contao-module

6.2.4.alpha 2017-12-22 11:21 UTC

README

https://github.com/markocupic/gallery-creator-bundle

Gallery Creator

Contao 3的前端模块

该模块可以管理创建相册。该模块非常灵活,提供相册概览和详情视图。

"gc_generateFrontendTemplate"-钩子

使用"gc_generateFrontendTemplate"-钩子可以调整前端输出。在处理Gallery Creator前端模板之前执行"gc_generateFrontendTemplate"-钩子。它传递模块对象,在详情视图中传递当前相册对象。期望返回模板对象。自4.8.0版本添加。

<?php
// config.php
$GLOBALS['TL_HOOKS']['gc_generateFrontendTemplate'][] = array('MyGalleryCreatorClass', 'doSomething');

// MyGalleryCreatorClass.php
class MyGalleryCreatorClass extends \System
{

       /**
        * Do some custom modifications
        * @param Module $objModule
        * @param null $objAlbum
        * @return mixed
        */
       public function doSomething(\Module $objModule, $objAlbum=null)
       {
              global $objPage;
              $objPage->pageTitle = 'Bildergalerie';
              if($objAlbum !== null)
              {
                     // display the album name in the head section of your page (title tag)
                     $objPage->pageTitle = specialchars($objAlbum->name);
                     // display the album comment in the head section of your page (description tag)
                     $objPage->description = specialchars(strip_tags($objAlbum->comment));
                     // add the album name to the keywords in the head section of your page (keywords tag)
                     $GLOBALS['TL_KEYWORDS'] .= ',' . specialchars($objAlbum->name) . ',' . specialchars($objAlbum->event_location);
              }
              return $objModule->Template;
       }
}

使用Gallery Creator祝你玩得开心!!!