notification-bundle icon indicating copy to clipboard operation
notification-bundle copied to clipboard

Add examples in documentation

Open maximilienGilet opened this issue 7 years ago • 16 comments

Add use case example and integration examples (eg JS dropdowns)

maximilienGilet avatar Nov 24 '17 10:11 maximilienGilet

Hello Maximillien,

Your bundle seems very cool, and I'd like to use it, but it suffer of a lack of documentation; especially a full example.

I've tried to implement the twig function {{ mgilet_notification_render(notifiableEntity) }} but how did you really used it ? especially if notifiableEntity is in a user namespace ?

Please have in mind that a doc should be a highest priority than a new major version (my point of view).

BTW, thanks for your work. Laurent

llaville avatar Mar 25 '18 07:03 llaville

Hi Laurent,

The function {{ mgilet_notification_render(notifiableEntity) }} will render a simple ul li list of notifications. You can override the view or use a custom view.

See here for more details.

I think more documentation is needed but I currently don't have much time for this.

If you want to add more example and details, feel free to submit a pull request.

Thanks for using the bundle 😄

maximilienGilet avatar Mar 26 '18 08:03 maximilienGilet

Hello Maximilien,

Finally I've tested it yesterday, and I like it. Even if it was difficult to understand how to use it. Finally nothing is impossible !

When I'll finish my current learn steps, I'll propose a full example (to contribute). Thanks for your reply

llaville avatar Mar 26 '18 14:03 llaville

I made a simple demo repository for sample implementation. It's running Symfony 4 and uses the dev branch of the bundle (working on it to get full compatibility with flex).

https://github.com/maximilienGilet/notification-bundle-demo

maximilienGilet avatar Apr 15 '18 21:04 maximilienGilet

Thanks for sharing this Maximilien. I'll have a look later on this demo repo !

llaville avatar Apr 16 '18 11:04 llaville

Thank you Maximilien for creating and sharing this bundle. Nice work. I've checked the documentation and the demo bundle you've created, but I still do not understand how to use the events? I do receive the events in a custom created listener, but after receiving the JSON response I would like to return to the page/controller/route. How can I do that?

Kind regards

PDirkx avatar Dec 14 '18 10:12 PDirkx

Hi @PDirkx thanks for using this bundle !

In order to use the events provided by the bundle, you can create an EventListener or an EventSubscriber.

Symfony documentation : https://symfony.com/doc/current/event_dispatcher.html

:)

maximilienGilet avatar Dec 17 '18 08:12 maximilienGilet

Hello I want to add a notification sound when a user places an order on an e-commerce application I want to know if this bundle is responding to my need, if yes have you an example.

kamelaBessas20 avatar Mar 20 '19 16:03 kamelaBessas20

@llaville please can you share me the code of twig? i want to see notifications like this gif https://camo.githubusercontent.com/aa3ef4e798bf4d2ac1aca1e6fa048f2ea40f6360/687474703a2f2f692e696d6775722e636f6d2f30374f634636632e676966

khaliltr avatar Apr 11 '19 21:04 khaliltr

@PDirkx Are you getting this error Unable to find template "MgiletNotificationBundle::notification_list.html.twig" cause I am. This happens in case of {{ mgilet_notification_render(user) }} function

aquibbaig avatar Apr 21 '19 10:04 aquibbaig

Notifications are getting stored but are not rendered by the function

aquibbaig avatar Apr 21 '19 10:04 aquibbaig

Hello Maximilien,

Finally I've tested it yesterday, and I like it. Even if it was difficult to understand how to use it. Finally nothing is impossible !

When I'll finish my current learn steps, I'll propose a full example (to contribute). Thanks for your reply

Hi, I want to use this bundle for an internship but I couldn't quite understand the documentation. Can you help me with it please?

aquibbaig avatar May 17 '19 14:05 aquibbaig

Hello, I found a probleme in display the list notification. Maximilien can you provide us with the .html.twig

medkarim-rebey avatar Dec 02 '19 00:12 medkarim-rebey

Hi, @medkarim-rebey. I have used this bundle in my GSoC project and I'm ready to help you out here. You can see an example .html.twig files inside your vendor/mgilet/notification-bundle/Resources/views directory, if you have correctly installed the bundle.

If you have any further problems, do let me know. Thanks!

aquibbaig avatar Dec 02 '19 04:12 aquibbaig

Hi,@aquibbaig ,I'm already using html.twig .the probleme is in displaying the notification by the commande {{ mgilet_notification_render(app.user) }} .I couldn't quite understand the commande. Can you help me with it ?,Thanks

medkarim-rebey avatar Dec 02 '19 07:12 medkarim-rebey

{{ mgilet_notification_render(app.user) }} is a Twig helper which can be used as a templating expression in your twig files. You can hop over to vendor/mgilet/notification-bundle/Twig/NotificationExtension.php and check the getFunctions and render methods over there. It just does a for loop on all the notifications and renders them on a template, in this example .html.twig file.

aquibbaig avatar Dec 02 '19 09:12 aquibbaig