2017 © Pedro Peláez
 

symfony-bundle content-bundle

This bundle provides localized content management

image

vladislavs/content-bundle

This bundle provides localized content management

  • Thursday, December 22, 2016
  • by vladislavs
  • Repository
  • 1 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 20 % Grown

The README.md

README

Build Status Latest Stable Version Total Downloads, (*1)

License here., (*2)

What is Arcana Content Bundle?

Arcana Content Bundle allows administrators to edit texts directly in the page, not some separate Admin section., (*3)

Requirements

Installation

Bundle can be installed via Composer. You can find this bundle on packagist: https://packagist.org/packages/arcanacode/content-bundle, (*4)


// composer.json
{
    // ...
    require: {
        // ..
        "arcanacode/content-bundle": "dev-master"

    }
}

Then, you can install the new dependencies by running Composer's update command from the directory where your composer.json file is located:, (*5)


    php composer.phar update

You have to add this bundle to AppKernel.php register bundles method, so that Symfony can use it., (*6)

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new Arcana\Bundle\ContentBundle\ArcanaContentBundle(),
);

In your config.yml you must add this bundle to jms_di_extra., (*7)

jms_di_extra:
    locations:
        bundles: [ ArcanaContentBundle ]

Next add bundle to the 'app/config/routing.yml' file., (*8)

arcana_content:
    resource: "@ArcanaContentBundle/Controller/"
    type:     annotation

In base template file include stylesheets and javascripts for only users with ROLE_ADMIN, (*9)

{% if is_granted('ROLE_ADMIN') %}
    {% stylesheets filter="cssrewrite"
        "bundles/arcanacontent/vendor/raptor/raptor-custom-front-end.min.css"
    %}
        
    {% endstylesheets %}
{% endif %}
{% if is_granted('ROLE_ADMIN') %}
    {% javascripts
        "bundles/arcanacontent/vendor/raptor/raptor.custom.min.js"
        "bundles/arcanacontent/js/manager.js"
    %}
        
    {% endjavascripts %}

    
{% endif %}

Put somewhere in your base template, (*10)

window.arcana_content_manager.contentSaveUrl = '{{ path('arcana_content_save') }}';

In your security.yml file restrict access for arcana_content_save path only to administrators., (*11)

access_control:
    //..
    - { path: ^/save, roles: ROLE_ADMIN }

Finally run app/console doctrine:schema:update --force to create 'content' table in your database., (*12)

Usage

In order to use the bundle, all texts you want to be able to edit, must be added to template with content filter in such format:, (*13)

{{ 'default value' | content('name', {options}) }}

'default value' is the default text, that will appear if no content is found in database. 'name' is the name of content in the content table. 'options' - array of options (listed below). Example:, (*14)

{{ 'Welcome to the Arcana Content Bundle!' | content('default_page_title', { editable_separately: true, type: 'plaintext' }) }}

You can also use large text blocks (also with html tags) without using a default value, for example:, (*15)


{% content of "facts_text" %}
   
            Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc rhoncus massa et dui tempor facilisis. In a luctus erat. Morbi eget tellus fermentum, pretium arcu sed, congue arcu. 
       
{% endcontent %}

Separately editable texts, (*16)

{{ 'You can edit me separately' | content('separate_title_tag', { editable_separately: true, type: 'plaintext' }) }}

Separately editable texts are texts, that are not visible on the page, for example "title" tag. You can edit them by opening "Separately editable contents" popup., (*17)

Options available: 'editable_separately' - if 'true', will be editable in separately editable contents popup 'type': 'plaintext'/'block'/'inline'/'anchor' - NEED DESCRIPTION, (*18)

Contributing

Pull requests are welcome., (*19)

Description here., (*20)

Running Symfony2 Tests

Description here., (*21)

The Versions

22/12 2016

dev-master

9999999-dev http://github.com/vladislavs/content-bundle

This bundle provides localized content management

  Sources   Download

MIT

The Requires

 

by Ivo Azirjans

twig bundle symfony content vladislavs

26/04 2014

dev-develop

dev-develop http://github.com/arcanacode/content-bundle

This bundle provides localized content management

  Sources   Download

MIT

The Requires

 

by Ivo Azirjans

twig bundle symfony content arcana

25/04 2014

2.4.1

2.4.1.0 http://github.com/arcanacode/content-bundle

This bundle provides localized content management

  Sources   Download

MIT

The Requires

 

by Ivo Azirjans

twig bundle symfony content arcana

24/04 2014

v2.4.0

2.4.0.0 http://github.com/arcanacode/content-bundle

This bundle provides localized content management

  Sources   Download

MIT

The Requires

 

by Ivo Azirjans

twig bundle symfony content arcana