angel/galleries

此软件包最新版本(dev-master)的许可信息不可用。

dev-master 2014-08-26 18:41 UTC

This package is not auto-updated.

Last update: 2024-09-24 02:23:56 UTC


README

这是一个为 Angel CMS(https://github.com/JVMartin/angel)开发的模块。

此模块允许您创建多个“画廊”,每个画廊都有自己的图片集合。

安装

将以下要求添加到您的 composer.json 文件中

"require": {
	"angel/galleries": "dev-master"
},

执行 composer update 命令以安装软件包。

将以下服务提供者添加到您的 app/config/app.php 文件中的 providers 数组中

'Angel\Galleries\GalleriesServiceProvider',
'Intervention\Image\ImageServiceProvider'

将以下别名添加到您的 app/config/app.php 文件中的 aliases 数组中

'Image' 		  => 'Intervention\Image\Facades\Image'

执行以下命令

php artisan migrate --package="angel/galleries"  # Run the migrations
php artisan asset:publish                        # Publish the assets
php artisan config:publish angel/galleries       # Publish the config

打开您的 app/config/packages/angel/core/config.php 文件,并将画廊路由添加到 menu 数组中

'menu' => array(
	'Pages'     => 'pages',
	'Menus'     => 'menus',
	'Galleries' => 'galleries', // <--- Add this line
	'Users'     => 'users',
	'Settings'  => 'settings'
),

...并将可链接菜单模型添加到 linkable_models 数组中

'linkable_models' => array(
	'Page'             => 'pages',
	'Gallery'          => 'galleries', // <--- Add this line
)

打开您的 app/config/packages/angel/galleries/config.php 文件,并定义您想要的缩略图设置。默认设置如下

array(
	'thumbs' => array(
		't' => array(
			'width' => 75,
			'height' => 75,
			'crop' => 1,
			'enlarge' => 1,
			'path' => '/uploads/images/t/'
		),
		's' => array(
			'width' => 150,
			'height' => 150,
			'crop' => 1,
			'enlarge' => 1,
			'path' => '/uploads/images/s/'
		),
		'm' => array(
			'width' => 300,
			'height' => 300,
			'crop' => 0,
			'enlarge' => 1,
			'path' => '/uploads/images/m/'
		),
		'l' => array(
			'width' => 600,
			'height' => 600,
			'crop' => 0,
			'enlarge' => 0,
			'path' => '/uploads/images/l/'
		)
	)
)

最后,请确保您实际上在保存缩略图图像的目录中创建了目录。这些路径相对于 /public/ 文件夹(例如:/public/uploads/images/t/)。