CAT | Workshop
A colleague of mine asked me to teach him web development. He’s a digital native and he worked on the management side of internet projects for a few years, he understands the business but he has no clue about programming and such.
I thought lets teach him some basics.
My employer is a big magazine publishing house and in the three years working there I had the opportunity to work on or just follow the development of more than 20 editorial websites. These included very different types of sites; some community driven, some purely editorial, some service providing and more.
There have been many differen requirements but most of the time the requested features were reoccuring in similar ways.
One of most frequently requested feature was to provide an admin tool to compose homepage (a.k.a. indexpages, sectionhomes, channels,..). An editor should be able to compose the layout of a homepage by positioning design elements like top teasers, slideshows, two column boxes, three column boxes and so forth and furthermore he should be able to manually assign contents to those elements. These contents of course can be of various types like article, galleries, doissiers, quizzes, etc..
This is my approach to solve this requirement once and for all!
In yesterdays post I boldly proclaimed saving symfony forms in dedicated actions rather than in components as a best practice.
A comment by Francisco then pointed out that this way the validation errors go missing when redisplaying the form.
So I had to get my hands dirty and show some code.
But you will have realised that all images generated have ugly path and file names. That might not matter much to your backend application but it will to what the user sees. So today I will focus on those nice URLs.
I’m going to use Doctrine in this post but everything will work exactly the same for Propel.
In this part I will focus on a rather simple integration with the following requirements:
- Show thumbnails generated by sfImageTransformExtraPlugin in edit form instead of the original
- Show thumbnails generated by sfImageTransformExtraPlugin in list instead of the original
- Automatically remove outdated thumbnails when the source has changed
When you start developing your models in symfony project the next thing you want is to play around with them.
For this you need some entries in your database and the solution to this are fixtures. This post is about how to deal with Doctrine relations within your fixtures.
During the time I spend with some colleagues of mine who just started on a big new project I was faced with a tricky yet simple requirement and it took me some time to find a solution for it.
Finally the solution seems to be both elegant and simple so why not share it with the world?
I just did another small workshop for about 10 people. The topic was how to develop your projects modules within plugins and not in your application.
This was relevant to them because they will be working on multiple projects that share a lot of functionality and we all learned by now that plugins help you doing just that.
Because I was quite pleased with my small demonstration of all this I decided to put in online.