harentius / blog-bundle
Symfony Bundle for adding simple blog functionality to existing or new Symfony project.
Installs: 374
Dependents: 1
Suggesters: 0
Security: 0
Stars: 19
Watchers: 5
Forks: 7
Open Issues: 5
Type:symfony-bundle
Requires
- php: ^7.0
- ext-apcu: *
- ext-json: *
- beberlei/doctrineextensions: ^1.2
- doctrine/doctrine-bundle: ^1.12 || ^2.0
- doctrine/orm: ^2.7
- eko/feedbundle: ^2.0
- friendsofsymfony/jsrouting-bundle: ^2.4
- hautelook/alice-bundle: ^2.5
- knplabs/knp-menu-bundle: ^2.3
- knplabs/knp-paginator-bundle: ^4.1 || ^5.0
- liip/imagine-bundle: ^2.2
- mhujer/breadcrumbs-bundle: ^1.5
- monolog/monolog: ^1.22
- presta/sitemap-bundle: ^1.7
- sensio/framework-extra-bundle: ^5.5
- sonata-project/admin-bundle: ^3.56
- sonata-project/doctrine-orm-admin-bundle: ^3.12
- sonata-project/translation-bundle: ^2.4
- stof/doctrine-extensions-bundle: ^1.3
- symfony/asset: ^4.4
- symfony/console: ^4.4
- symfony/dotenv: ^4.4
- symfony/framework-bundle: ^4.4
- symfony/intl: ^4.4
- symfony/monolog-bundle: ^3.5
- symfony/security-bundle: ^4.4
- symfony/translation: ^4.4
- symfony/twig-bundle: ^4.4
- symfony/yaml: ^4.4
- twig/twig: ^2.12|^3.0
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.3
- phpstan/phpstan: ^0.12
- phpstan/phpstan-phpunit: ^0.12
- phpunit/phpunit: ^8.5
This package is auto-updated.
Last update: 2024-10-27 16:15:30 UTC
README
Symfony Bundle for adding simple blog functionality to existing or new Symfony project.
Requirements
Version ^4.0 - Symfony ^4.0, twig/twig:^2.0
Version ^3.0 - Symfony ^3.0
Version ^1.0|^2.0 - Symfony ^2.7
Installation
1. With Symfony Flex
TODO
2. Without Symfony Flex
- Install bundle
$ composer.phar require harentius/blog-bundle
- Add bundles (in config/bundles.php or Kernel):
<?php // config/bundles.php return [ //... Harentius\BlogBundle\HarentiusBlogBundle::class => ['all' => true], //... Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true], Knp\Bundle\PaginatorBundle\KnpPaginatorBundle::class => ['all' => true], Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true], WhiteOctober\BreadcrumbsBundle\WhiteOctoberBreadcrumbsBundle::class => ['all' => true], Sonata\CoreBundle\SonataCoreBundle::class => ['all' => true], Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true], Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle::class => ['all' => true], Sonata\AdminBundle\SonataAdminBundle::class => ['all' => true], Sonata\TranslationBundle\SonataTranslationBundle::class => ['all' => true], Sonata\Doctrine\Bridge\Symfony\Bundle\SonataDoctrineBundle::class => ['all' => true], FOS\JsRoutingBundle\FOSJsRoutingBundle::class => ['all' => true], Presta\SitemapBundle\PrestaSitemapBundle::class => ['all' => true], Eko\FeedBundle\EkoFeedBundle::class => ['all' => true], Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true], Hautelook\AliceBundle\HautelookAliceBundle::class => ['all' => true], Fidry\AliceDataFixtures\Bridge\Symfony\FidryAliceDataFixturesBundle::class => ['all' => true], Nelmio\Alice\Bridge\Symfony\NelmioAliceBundle::class => ['all' => true], ];
Please note that HarentiusBlogBundle can provide default configuration for other bundles.
To make this work, HarentiusBlogBundle should be registered before other bundles
HarentiusBlogBundle also has default security config. So please make sure it does not conflict with your app config or skip using it
- Include routes:
# config/routes.yaml blog: resource: "@HarentiusBlogBundle/Resources/config/routing.yml" prefix: /
- Include default configs:
Note: this step can be skipped if you decide to configure bundles (i.e. DoctrineBundle, SecurityBundle, etc) yourself
# config/packages/harentius_blog.yaml imports: - { resource: '@HarentiusBlogBundle/Resources/config/config.yml' }
Configuration
Config reference:
harentius_blog: # Localizations to be used by blog locales: ['en', 'uk'] primary_locale: 'en' articles: # Path where previews stored image_previews_base_uri: /assets/images/preview/ sidebar: # ~ - no cache, 0 - unlimited cache cache_lifetime: 3600 # Max tags number (ordered by max popularity) tags_limit: 10 # Percent tags size, unlimited variants number (valid values: [50, 100], [25, 50, 75, 100], etc) tag_sizes: [65, 80, 100] homepage: # ~ - no page, feed only or page slug page_slug: index # ~ - no feed feed: # ~ - all category: ~ # Last articles number number: 5 list: posts_per_page: 20 # For avoiding internal apc cache conflicts if run multiple sites on one server. cache: apc_global_prefix: blog
Post Installation/Configuration actions
- Create/Update your DB according to chosen installation type
bin/console doctrine:database:create # If fresh installation
bin/console doctrine:schema:create
- Install assets
bin/console assets:install --symlink
- Load fixtures (optional)
bin/console hautelook:fixtures:load
Additional Resources
https://folkprog.net - example of blog based on this bundle.
https://github.com/harentius/folkprog - git repository with sources of this blog.