koala/content-bundle

此包已被废弃且不再维护。未建议替换包。

使用 Mercury Editor 的简单 Symfony 2 CMS 包

安装: 71

依赖者: 0

建议者: 0

安全: 0

星标: 11

关注者: 3

分支: 4

开放问题: 0

类型:symfony-bundle

dev-master 2012-12-05 10:03 UTC

This package is not auto-updated.

Last update: 2020-01-24 14:52:24 UTC


README

KoalaContentBundle 是一个使用惊人的 Mercury Editor 作为前端编辑器的简单 CMS,专为 Symfony 2 框架构建。

Build Status

使用 composer 安装(Symfony 2.1)

将 koala/content-bundle 添加到 composer.json。

"require": {
    ...
    "koala/content-bundle": "dev-master"        
}

然后运行 composer update 安装 KoalaContentBundle 及其所有依赖。Composer 将自动注册新的命名空间。

配置

在您的 app/AppKernel.php 文件中注册新包

public function registerBundles()
{
    $bundles = array(
        ...
        new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
        new Knp\Bundle\MenuBundle\KnpMenuBundle(),
        new Symfony\Cmf\Bundle\RoutingExtraBundle\SymfonyCmfRoutingExtraBundle(),
        new Koala\ContentBundle\KoalaContentBundle(),
    );

    return $bundles;
}

在您的 app/config/config.yml 文件中启用 Doctrine Tree 扩展和 Symfony CMF 路由

stof_doctrine_extensions:
    orm:
        default:
            tree: true

symfony_cmf_routing_extra:
    chain:
        routers_by_id:
            koala_content.dynamic_router: 200
            router.default: 100

安装资源

php app/console assets:install --symlink web

web/mercury 下安装 Mercury 文件。建议使用最新版本,目前为 0.8。(参见 Mercury 下载

https://github.com/downloads/jejacks0n/mercury/mercury-v0.8.0.zip 下载并解压到 web/mercury

下一步是为包工作设置所需的路由。将以下内容添加到您的 app/config/routing.yml

koala_content:
    resource: @KoalaContentBundle/Resources/config/routing.yml
    prefix: /

_注意:默认情况下,Symfony 在 app/config/routing_dev.yml 中有一个欢迎路由,如果您想使用根路由,则需要删除它。

如果您想将内容页面放在单独的分区中,可以将前缀更改为类似 /cms 的内容

最后一步是更新数据库模式并加载一些默认内容。在运行设置命令之前,请确保您已设置数据库配置在 app/config/parameters.yml

php app/console koala_content:setup

现在打开您的浏览器开始编辑!

外部要求