John Cleveley @jcleveley on the Symfony admin generator
@jcleveley gave an excellent talk on the Symfony admin generator at #sflive2010. Here are my notes.
Hi folks, I’m attending Symfony Live 2010. These are my notes from Thomas Rabaix’s talk on internationalization in Symfony, with a few offhand remarks of my own.
Thomas Rabaix talk on internationalization
URL: routingModel: doctrine + propel
Form: sfForm
Most of the 18n is based on Prado framework
ICU data updated in sf1.3/sf1.4
You need
all:
.settings:
i18n: true
default_culture: en
Culture detection
HTTP request -> culture in URL
If no culture in URL, culture in session
What about culture in the header?
Updates sfRouting, sf18n, executes controller
We’re not big on culture in URL in apostrophe since the session can do it but it’s nice to be able to bookmark.
We have labored long and hard to prepare for the 1.0 release of Apostrophe. As we said before, it has been stable and in use for a long time now, but we wanted to mark a moment in time with an official release.
Probably the easiest way to get a feel for Apostrophe is to go to our demo site and login. The user name is “admin” and the password is “demo”. Keep in mind that the content resets itself every hour on the hour.
If you want to get your bearings before you you do that, head over to the newly revamped Apostrophe site. For the very interested, you should consider checking out our extensive README which includes an Installation section, an Editor’s guide, a Designer’s guide and a Developer’s guide.
Now for some of the highlights.
Slots!
There are rich text, image, slideshow, video, button, PDF, Raw HTML, and other slots built in. If you have used Apostrophe before, you know that you can add a slot on a page, choose what you want to place and then reorder it. New custom slots can also be made for any project.
Slot Options
For some time we have wanted to be able to give you more fine control of a specific slot. For instance, what if you wanted to make the background color of a some text slots yellow, and some white? In the past that would have required two slots. Now, it can just be an option of the same text slot. In this screenshot, you can see that we allow you to switch between different types of slideshows. Make sure you try that out in the demo. It is probably our favorite new feature. We really sweated the details on making sure the option control was contextual. We hope you appreciate the effort.
There are many other new features and highlights, but for the moment I will leave you to find them in the demo (remember: user is “admin” and password is “demo”) or in the documentation. (We promise to highlight these in future posts.)
So, what does this mean to you?
Well, it depends. If you are a PHP developer with Symfony skills you can get started today. From our README:
Right now Apostrophe is best suited to PHP developers who want to make an intuitive content management system available to their clients. Apostrophe is very easy for your clients to edit, administer and maintain once it is set up. Right now, though, Apostrophe installations does call for some command line skills and a willingness to learn about Symfony. We are working to reduce the learning curve.
If you are a front-end developer and want to get started using Apostrophe, talk to us. We are in the process of working out a package where we set up a staging server with Symfony and Apostrophe running on it. We would train you on templating in Apostrophe and you should be up in running in a day or two.
If you don’t want to go that route, here is what we suggest:
Front-end developers who do not yet have PHP and Symfony skills but wish to set up an Apostrophe site by themselves should consider tackling the Symfony tutorial to get up to speed. It’s not necessary to complete the entire tutorial, but it helps to have at least a passing familiarity with Symfony.
If you just think Apostrophe is rad and you want one… like now, just drop us a line. We would be happy to design and implement an Apostrophe site for you. You would be joining some good company if you do.
Surprise!
We (more accurately Tom) decided to build an extra slot last night as a gift for making you wait an extra day. Isn’t that nice of us (him)?
If you are observant you may have noticed an extra slot in the screenshot above. So without further ado, we present the Feed Slot (commonly referred to as the RSS Feed slot, but it will take Atom feeds as well). Use this to bring in your Twitter updates or maybe our Apostrophe SVN code commit feed.
Feel free to thank us anytime. (We like expensive beer.)
This is really just the beginning. We hope you have an opportunity to check out Apostrophe. We would love to hear from you if you do. Comments below would be much appreciated (and read), as well.
__________________
Don’t forget to follow us on Twitter for on-going updates: @apostrophenow
If you are a developer, the Apostrophe Trac is the home of the open source community. On that site you can open support tickets, browse and contribute to the Wiki, and access and potentially contribute to the source code via svn (you’ll need to contact us if you want write access).
Also, please join the Apostrophe Google Group if you want to tap into the community of people using Apostrophe to get support and help.
We have decided to push back the release of Apostrophe 1.0 until tomorrow.
We are truly in the home stretch. Just hitting a few bugs, finishing up documentation and adding some instructional content to the demo site. To tide you over, we are publishing this screencast of how you add video to a project by searching YouTube from within Apostrophe. Note how we bring in associated metadata (url, title, etc). For the record, you can add video by pasting in embed codes from countless other services like Viddler and Vimeo.
Please tune back in tomorrow.
P.S. We are not blaming the snow for the delay, but did want to note that we are certainly under a deep white blanket here in Philadelphia.
You may be wondering why we haven’t made an official 1.0 release to date?
The answer is simply that every time we were going to do that, we decided that it could use one more cool feature or could be re-factored in this way or that. No regrets, though. For this first official 1.0 release, we have done so many under-the-hood changes and updates that we are glad we waited.
I wanted to post to let you know that we will be sharing screencasts and screenshots of features over the next few days leading up to the release (and beyond). Hold on to your hat and get ready for the ride.
Coincidently, we are timing this release so that it was ready for Symfony Live. Tom will be in attendance spreading the good word. If you are planning on being there, drop us a line so Tom can buy you a drink.
The discussion will begin at 7pm. Food and drink at 6pm.
Please join us this Thursday, February 4th at 6pm for the Junto. This month we will be discussing the book The Complete Persepolis to coordinate with One Book, One Philadelphia. We will start the evening off by watching a clip from the film version of Persepolis. We will follow that up with a discussion led by Siobhan Reardon, President & Director of the Free Library of Philadelphia.
After exceeding its 90-day mission by SEVEN. FREAKING. YEARS, the Spirit Mars rover is permanently stuck. So sad!
Yes, they plan to do some stationary science work with it when the winter is over, but let’s face it… this is the end.
Philadelphians, please join me tonight at 7pm at National Mechanics (*) to pour out a drop for our fallen robot homie!
To be followed, no doubt, by watching the State of the Union address. Which might even touch on space policy for once.
Let’s give Spirit a Viking funeral! (**)
(*) 3rd between Chestnut and Market if anybody doesn’t already know.
(**) Failure to get this joke is punishable by deportment to the Phobos reeducation camp.
Not to toot our horn or nothin, but we’ve just launched a new site for ourselves. At 6:05pm on the last business day of the year we’ve cobbled our children some new shoes. It was a lot of fun making Apostrophe flex a little to suit our own needs. We figured it was time to drink our own koolaid. And it’s almost fully debugged (degrades gracefully) in IE.
Using svn for version control? Have lots of repositories you’re interested in? Maybe some of them aren’t under your control, so you can’t set up postcommit hooks?
Check out svncampfire (literally… haha, see what I did there). svncampfire pastes svn commit notices into your Campfire chatroom.
We’ve just released version 1.1, which supports the new official 37signals API for campfire. It’s a great API, much more fun than screenscraping; I chose the JSON flavor because it’s so darn easy. Version 1.1 also adds friendly labels for commits from each distinct repository so it’s easier to see what is going on.
Right now svncampfire is monitoring over half a dozen repositories for us, all thanks to the magic of svn log --xml.
Last month Batman decided he was too busy to keep track of a separate batman@batcave.com email inbox. Especially since the economic downturn had forced him to lay off Alfred.
So he forwarded all of his batman@batcave.com email to his gmail account, brucewayne@gmail.com. (Sshh! Nobody knows.)
At first this was almost but not quite awesome. In fact, Batman spent a month wondering if gmail was just another impractical, slow-moving, overly talkative attempt to kill him. But as he mastered the ropes the brilliance of using gmail for multiple identities became clear.
Batman may be a loner, but he does appreciate the value of teamwork. So for the rest of you superheroes out there, here are Batman’s three crucial steps for multiple identity management in gmail:
1. You need to know who you are. Messages addressed to a particular identity need to be easily recognizable. You can achieve this quickly with gmail’s filters feature:
Click Settings -> Filters -> Create a New Filter
Enter the identity’s email address in the “To:” field
Click Next Step
Check “Apply the label”
Select “New Label”
Enter a descriptive label like “Batman” or “batcave”
Click “Create Filter.”
Now you can painlessly distinguish your Batman emails from your Bruce Wayne emails. In addition to showing up with a visible label in your regular inbox view, you can also filter to just a particular label by clicking on it in the left-hand column.
2. GMail needs to know who you are. When you reply to a message sent to a particular identity, you want your reply to come from that identity’s email address, not your personal email address. And you don’t want to be forced to select that manually – it needs to be the default or you’ll soon be having conversations about work at your personal address.
To set this up:
Settings -> Accounts and Import -> Send Mail As
Click “Send mail from another address”
Add batman@batcave.com
You can configure gmail to use your own domain’s mail servers rather than just sending through gmail. The former takes a bit more work, but it does keep your personal email address out of the headers completely, so it may be worth the effort for you. In practice hardly anybody looks at the headers closely, just as hardly anybody notices that Batman and Bruce Wayne have exactly the same build. Smoke and mirrors, baby.
Now, here’s the bit I missed the first time: you’re not done yet. You want to make sure that replies automatically come from the identity under which you received the message.
To fix that:
Settings -> Accounts and Import -> Send Mail As
Under “When receiving a message,” select “Reply from the same address the message was sent to.”
The default is to always send mail as your personal address, which is not what you want.
You can also choose to send messages from any of your configured addresses when composing new messages that are not replies. It’s important to keep in mind that your personal identity is still the default for new messages that are not replies (unless you change the default, of course).
3. If you use web forms that send you email, you want your replies to go to the right person. If you have set up various web forms that allow citizens to contact you in the event of a Joker attack, you are probably using the “Reply-To” field to indicate the citizen who should get your replies. More than likely the “From” field is defaulting to batman@batcave.com… the same address Bruce configured gmail to send mail from when he’s Batman.
Unfortunately, gmail has a quirk: if the “From” line of the message you’re replying to happens to be one of your “send mail from” addresses, gmail will ignore the “Reply-To” line, even though it shows up in “Show Details.” This is completely baffling and guaranteed to drive you insane, which is exactly what the Joker wants. (“Don’t Be Evil” is just a front, right?)
The solution is simple: change the “From” line of the emails you’re receiving from your web forms. If you coded those forms, you should be able to override the “From” line. In PHP it looks like this: