2017 © Pedro Peláez
 

symfony-bundle project-light-bundle

Adds the University of Cambridge's house style to your Symfony2 application.

image

misd/project-light-bundle

Adds the University of Cambridge's house style to your Symfony2 application.

  • Friday, January 2, 2015
  • by thewilkybarkid
  • Repository
  • 8 Watchers
  • 1 Stars
  • 88 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ProjectLightBundle

Adds the University of Cambridge's house style to your Symfony2 application., (*1)

Authors

Installation

  1. Add the ProjectLightBundle to your dependencies:, (*2)

    // composer.json
    
    {
       // ...
       "require": {
           // ...
           "misd/project-light-bundle": "~1.0@dev"
       }
    }
  2. Use Composer to download and install the ProjectLightBundle:, (*3)

    $ php composer.phar update misd/project-light-bundle
  3. Register the bundle in your application:, (*4)

    // app/AppKernel.php
    
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new Misd\ProjectLightBundle\ProjectLightBundle()
        );
    }

Project Light assets

The bundle contains all of the Project Light assets (stylesheet, JavaScript and images)., (*5)

Base template

Either extend the base template:, (*6)

{% extends 'ProjectLightBundle::base.html.twig' %}

Or one of the themes:, (*7)

{% extends 'ProjectLightBundle::theme_blue.html.twig' %}
{% extends 'ProjectLightBundle::theme_green.html.twig' %}
{% extends 'ProjectLightBundle::theme_grey.html.twig' %}
{% extends 'ProjectLightBundle::theme_orange.html.twig' %}
{% extends 'ProjectLightBundle::theme_purple.html.twig' %}
{% extends 'ProjectLightBundle::theme_red.html.twig' %}
{% extends 'ProjectLightBundle::theme_turquoise.html.twig' %}

title

The HTML <title> can be set in the title block. This is blank by default., (*8)

Example:, (*9)

{% block title %}My title{% endblock %}

stylesheets

Local stylesheets can be included in the stylesheets block., (*10)

Example:, (*11)

{% block stylesheets %}
<link rel="stylesheet" href="{{ asset('path/to/my/stylesheet.css') }}">
{% endblock %}

theme

If not extending one of the specific theme templates, you can set it in the theme block., (*12)

Example:, (*13)

{% block theme %}campl-theme-3{% endblock %}

content

This contains all content (including the local header)., (*14)

A local footer can be included in the footer block., (*15)

javascripts

Local JavaScript files can be included in the javascripts block. This appear at the end of the page (ie before the </body>)., (*16)

Example:, (*17)

{% block javascripts %}
<script src="{{ asset('path/to/my/javascript.css' }}"></script>
{% endblock %}

partnerships

Partnership branding can be included in the partnerships block., (*18)

Example:, (*19)

{% block partnerships %}

    <div class="campl-row campl-content">
        <div class="campl-wrap clearfix">
            <div class="campl-column12 campl-partnership-branding">
                <div class="campl-content-container campl-side-padding">
                    <div class="campl-content-container campl-logo-container campl-bottom-padding">
                        <p class="campl-branding-title">Supported by</p>
                        <ul class="campl-unstyled-list campl-logo-list campl-horizontal-navigation clearfix">
                            <li><img src="{{ asset('path/to/the/logo.png') }}" alt="Some Company"/></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>

{% endblock %}

Notifications

The bundle comes with a template for notifications, which you can use like:, (*20)

{% for level, messages in app.session.flashbag.all() %}
    {% for message in messages %}
        {% include 'ProjectLightBundle:Component:notification.html.twig' with {level: level, text: message} %}
    {% endfor %}
{% endfor %}

Expected levels are success, warning, alert and information (default)., (*21)

KnpMenu render

The bundle comes with a custom menu renderer which replaces the default. If you want to use your own renderer, you can configure the KnpMenuBundle as normal., (*22)

Pagerfanta view

The bundle comes with a custom view which replaces the default. If you want to use your own view, you can configure the WhiteOctoberPagerfantaBundle as normal., (*23)

The Versions

02/01 2015

dev-master

9999999-dev https://github.com/misd-service-development/project-light-bundle

Adds the University of Cambridge's house style to your Symfony2 application.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chris Wilkinson