GithubHelp home page GithubHelp logo

manuxi / sulueventbundle Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 2.0 203 KB

Passing event- and locationsystem based on sulu workshop together in a bundle.

License: MIT License

PHP 99.09% Twig 0.91%
sulu bundle sulu-bundle sulucms

sulueventbundle's Introduction

SuluEventBundle!

php workflow symfony workflow GitHub license

This bundle was made based on Sulu workshop. I made it to have the possibility to manage events in my projects.

This bundle contains

  • Several filters for Event Content Type
  • Link Provider
  • Sitemap Provider
  • Handler for Trash Items
  • Handler for Automation
  • Possibility to assign a contact as author
  • Twig Extension for resolving events / get a list of events
  • Events for displaying Activities and more...

The news and their meta information is translatable.

It contains an example twig template.

The events and their meta information is translatable.

Please feel comfortable submitting feature requests. This bundle is still in development. Use at own risk ๐Ÿคž๐Ÿป

๐Ÿ‘ฉ๐Ÿปโ€๐Ÿญ Installation

Install the package with:

composer require manuxi/sulu-event-bundle

If you're not using Symfony Flex, you'll also need to add the bundle in your config/bundles.php file:

return [
    //...
    Manuxi\SuluEventBundle\SuluEventBundle::class => ['all' => true],
];

Please add the following to your routes_admin.yaml:

SuluEventBundle:
    resource: '@SuluEventBundle/Resources/config/routes_admin.yml'

Last but not least the schema of the database needs to be updated.

Some tables will be created (prefixed with app_):
location, event, event_translation, event_seo, event_excerpt (plus some ManyToMany relation tables).

See the needed queries with php bin/console doctrine:schema:update --dump-sql.
Update the schema by executing php bin/console doctrine:schema:update --force.

Make sure you only process the bundles schema updates!

๐ŸŽฃ Usage

First: Grant permissions for events. After page reload you should see the event item in the navigation. Start to create locations, then events. Use smart_content property type to show a list of events, e.g.:

<property name="events" type="smart_content">
    <meta>
        <title lang="en">Events</title>
        <title lang="de">Veranstaltungen</title>
    </meta>
    <params>
        <param name="provider" value="events"/>
        <param name="max_per_page" value="5"/>
        <param name="page_parameter" value="page"/>
    </params>
</property>

Example of the corresponding twig template for the event list:

{% for event in events %}
    <div class="col">
        <h2>
            {{ event.title }}
        </h2>
        <p>
            {{ event.startDate|format_datetime('full', 'none', locale=app.request.getLocale()) }}
            {% if endDate and startDate != endDate %}
                 - {{ event.endDate|format_datetime('full', 'none', locale=app.request.getLocale()) }}
            {% endif %}
        </p>
        <p>
            {{ event.summary|raw }}
        </p>
        <p>
            {{ event.text|raw }}
        </p>
        <p>
            {{ event.footer|raw }}
        </p>
        <p>
            <a class="btn btn-primary" href="{{ event.routePath }}" role="button">
                {{ "Read more..."|trans }} <i class="fa fa-angle-double-right"></i>
            </a>
        </p>
    </div>
{% endfor %}

Since the seo and excerpt tabs are available in the event editor, meta information can be provided like it's done as usual when rendering your pages.

๐Ÿงถ Configuration

There exists no configuration yet. I'm on it :)

๐Ÿ‘ฉโ€๐Ÿณ Contributing

For the sake of simplicity this extension was kept small. Please feel comfortable submitting issues or pull requests. As always I'd be glad to get your feedback to improve the extension :).

sulueventbundle's People

Contributors

manuxi avatar yeticgn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

yeticgn ktarila

sulueventbundle's Issues

Cannot use positional argument after named argument

Hi and thank you for your work.

I implemented this bundle with a sulu 2.5 fork and got the following error:

Fatal error: Uncaught Error: Cannot use positional argument after named argument in vendor/symfony/dependency-injection/ContainerBuilder.php:1060

Do you plan to update this bundle to match sulu 2.5?

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.