###Documentation under construction###
Hi! This is my Symfony 3 starter kit. It's certainly not perfect, so feel free to use and improve upon it. It comes with a bunch of nice bundles and a couple of basic blocks: image management with drag and drop and multi upload, simple comment management, simple widgets (ahem... very simple, don't get your hopes too high). It's really not a cms, you're not supposed to take it like it is. It has been created to be modified for your unique use-cases. With this starter, you can manage: Users, Pages, Articles, Images, Comments, Settings.
I'm writting a full documentation here, the website is made with this starter
- Symfony\Bundle\FrameworkBundle\FrameworkBundle
- Symfony\Bundle\SecurityBundle\SecurityBundle
- Symfony\Bundle\TwigBundle\TwigBundle
- Symfony\Bundle\MonologBundle\MonologBundle
- Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle
- Symfony\Bundle\AsseticBundle\AsseticBundle
- Doctrine\Bundle\DoctrineBundle\DoctrineBundle
- Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle
- FOS\UserBundle\FOSUserBundle
- FOS\JsRoutingBundle\FOSJsRoutingBundle
- JavierEguiluz\Bundle\EasyAdminBundle\EasyAdminBundle
- Vich\UploaderBundle\VichUploaderBundle
- Liip\ImagineBundle\LiipImagineBundle
- Ivory\CKEditorBundle\IvoryCKEditorBundle
MultiUpload, Drag and drop, sortable, resize
Juste use Imageable Trait in your entity
use AppBundle\Traits\Imageable; class Page { use Imageable; }
That's it! After that you can retreive your image with entity.getImages()
To show them on your view : asset("uploads/image/"~image.image)|imagine_filter('thumbnail')
Filters are defined in app/config/liip_imagine.yml
All image are online editable editable with the famous DarkroomJs
Just a tiny widget, type app_twig.getMap(your_lat,your_lng)|raw
on your view
You can change it easily on app/Resources/views/component/map
Juste use Imageable Trait in your entity
use AppBundle\Traits\Commentable;class Page { use Commentable;
}
That's it! After that you can retreive your comment with entity.getComments()
To get the form : app_twig.getCommentForm(entity)|raw
To get a predefined list, type app_twig.getCommentList(entity)|raw
, template are located in app/Resources/views/comment
You can allow and disallow anonymous comments by changing parameter allow_anonymous_comments to 0 or nop or non or no or x
You can set the comments to be published by default or not by changing the following parameter: validated_comments_by_defaut to 0 or nop or non or no or x
Another tiny widget, type app_twig.getAnalitycsTracking('your tracking code')|raw
on your view
If you set the parameter named tracking_code just do app_twig.getAnalitycsTracking()|raw
It will output the default analitycs code tracking
var _gaq = _gaq || []; _gaq.push(['_setAccount', 'your_code' ]); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();
Feel free to customize it, it's located in views/component/analitycs/
Just a tiny widget again (i know, i know...), Just type app_twig.getSlider(entity)|raw
on your view
It's the bootstrap slider. For now, it's made for imgeable entities, feel free to make your own :)
It's located in views/component/slider/
Type app_twig.getContactForm()
, you can customize fields on src/Type/ContactType.php
, the view is located on app/Resources/views/emails/contact
You may need to set your configuration on parameters.yml
Some settings are locked, but you can remove them by editing the file AppBundl/Listener/LifeCycleSliner.php
List of default settings :
- Default Slug route
- Analitycs tracking
- By default, comments published without moderation
- Allow anonymous comment
- Contact Email
- Website description
- Website name
/{slug} -> page
/blog -> articles index
/blog/{slug} -> article page
/image/{slug} -> image page
- Page and Article are by default commentable
- The template property create a template file located in app/Resources/views/article or page
- The property style add the style on the head of the page
Simple Menu Management (one level for now)
Position are changeable by drag and drop
if a menu item is related to a page or an article and he's parent title is modifed, the item uri is modified to
To get the main menu on view, type app_twig.getMenu()|raw
There is a twig helper named app_twig, the class is located at src/AppBundle/Service/AppService.php
It's also a service, you can use it on every controlleur
Retrieve Image on view for image property (Vich) : app_service.getImage(entity)
Get e bootstrap slider for imageable entities : app_service.getSlider(entity)|raw
Get the comment Form for commentable entities : app_service.getCommentForm(entity)|raw
Get the comment List for commentable entities : app_service.getcommentList(entity)|raw
Get the map widget : app_service.getMap(id_map,lat,lng,content)
Get analitycs tracking script code : app_service.getAnalitycsTracking(code)|raw
Retreive a setting's value : app_service.getSetting(key,type = false)
Get the main menu on view : app_twig.getMenu()|raw
There is a tiny little API
If you want your entity api capable, just use ApiCapable trait in it
You can customize the public / private on security.yml for method, by default, PUT and POST method require an admin role
It's just made for building for exemple a front with angular or somthing like that, you can set the api_key in parameters.yml
You need to add api_key in get parameter
GET /api/{model} -> Retreive all entity of a model
GET /api/{model}/{id} -> Retreive entity of a model with id
PUT /api/{model} -> update entity of a model
POST /api/{model} -> create entity of a model
It comes to my attention that it would be preferable to make a theme management, so i dit it
All theme need to be place in app/Ressources/views/themes
You can create theme from the back-office, if you don't put the directory corresponding to the folder name you gave, the system will propose you to create the whole theme structure
If you create the theme structure by the backoffice, no need to di anything, but if not, you need to create a symlink to web path like the defaut theme
You can do that by clicking on the link assets button on themes list
Done but not the doc for nowgit clone https://github.com/sohrabg/made-simple.git
composer install
Create an empty database
php bin/console app:init
php bin/console assets:install --symlink
Answer all question
Start to work
I a m working on this currently, so you may have to make php bin/console doctrine:schema:update --force
if you pull the project