Thanks Tom.
I've found a solution for i18n pages.I'll a post my "hack" in a few
days.
Here is what i did to add meta-tags to pages :
Screenshot :
http://dl.free.fr/ryoAywidB/apostrophe.jpg
- I added these lines in the config/doctrine/schema.yml
aPage:
columns:
keywords:
type: string(255)
description:
type: string(255)
- In apps\frontend\modules\a\actions\actions.class.php i added :
public function executeShow(sfWebRequest $request)
{ ......
$this->getResponse()->addMeta('keywords', $page->keywords);
$this->getResponse()->addMeta('description', $page->description);
......
return 'Template';
}
- In lib\form\doctrine\apostrophePlugin\aPageSettingsForm.class.php i
added :
class aPageSettingsForm extends aPageForm
{
...
public function configure()
{
parent::configure();
....
$this->setWidget('keywords', new sfWidgetFormTextarea());
$this->setWidget('description', new
sfWidgetFormTextarea());
....
It works but it's not clean because my code is too intrusive. When
i'll upgrade my project to the next apostrophe version, i'll have make
changes again to aPageSettingsForm.
My method don't follow the best practices. So my question is : is
there a way to add these meta-tags in a clean way by making a plugin ?
Thanks in advance.
Charles
On Jun 14, 5:11 pm, Tom Boutell <
t...@punkave.com> wrote:
> 1. Make subpages for /fr, /es, /en, etc. Don't call them
> /en/home-page, that would be redundant, just call them /en, /es, etc.
>
> 2. Write a custom action for the "root" home page which redirects you
> to the appropriate sub-homepage (/fr or /es or /en). Put the route for
> this action in your routing.yml *before* the a_page route so it "wins"
> for the / URL. You could get fancy and check whether the user is the
> superadmin and if they are give them a form to make a new subpage for
> a new language if they want.
>
> Writing actions, issuing redirects, etc. is just Symfony programming
> and I refer you to the Jobeet tutorial if you have not already
> completed it.
>
> On Mon, Jun 14, 2010 at 4:56 AM, Charles <
jc.du...@gmail.com> wrote:
> > Thank you Tom for your response. But i don't understand how to create
> > multi home pages from the apostrophe now interface ?
> > I need to have :
> > - $dns/home-page in english
> > - $dns/fr/page-accueil in french
> > - $dns/es/pagina-principal in spanish
>
> > Regards,
> > Charles
>
> > On Jun 10, 1:56 pm, Tom Boutell <
t...@punkave.com> wrote:
> >> Those Symfonyi18npractices you pointed to don't provide translated
> >> slugs either. And they suggest routes with the culture at the start of
> >> the URL, just as I did.
>
> >> I would make the home page for each language the /en page, /br page,
> >> etc. rather than creating an unnecessary additional level by putting
> >> the home page beneath that.
>
> >> The defaulti18nbehavior of Apostrophe is to use the same URL for all
> >> cultures and switch the language of the content provided based on the
> >> user's culture. To edit a page in another language you switch cultures
> >> yourself and then start editing to create the content for that page in
> >> that language. But you can internationalize the URLs instead if you
> >> wish following my alternative suggestion.
>
> >> On Thu, Jun 10, 2010 at 6:25 AM, Charles <
jc.du...@gmail.com> wrote:
> >> > Thank you very much for your quick response Tom.
> >> > If I understand your advice, the tree menu of the website should look
> >> > like this :
http://dl.free.fr/vicN3oI7M(screenshot). The home page
> >> > will be invisible for website "external users".
> >> > This "hack" could work but in my humble opinion, it doesn't follow
> >> > the i18nsymfony practices (
http://www.symfony-project.org/jobeet/
> >> > 1_4/Doctrine/en/19) and all advantages these practices give.
>
> >> > In fact i took a look at many CMS based and symfony, and i'm
> >> > considering to get involved in the Apostrophe Now project. But before
> >> > that i would like to "be reassured" on what direction the project will
> >> > take concerning internationalization. Most of my clients ask for
> >> > multilanguages websites and, still in my opinion,I18nsould be taken
> >> > in account very soon in a project.
> >> > I would be very interested to have your opinion in a PageI18n class
> >> > containing page translation attributes (page title, metadata page
> >> > keywords, metadata page description, slug...) ?
>
> >> > Thanks again for your answers.
>
> >> > Regards.
> >> > Charles
>
> >> > On Jun 9, 5:51 pm, Tom Boutell <
t...@punkave.com> wrote:
> >> >> Seems like you have separate subsites at that point and could just
> >> >> host them at /en, /de, etc. and redirect to those from the home page
> >> >> based on the user's culture (a small override to the a/show action
> >> >> which would otherwise just call parent::execute). Once the URLs
> >> >> themselves are translated the difference between what you want and
> >> >> what I'm suggesting (that can be done with stock Apostrophe) is very
> >> >> small.
>
> >> >> On Wed, Jun 9, 2010 at 11:28 AM, Charles <
jc.du...@gmail.com> wrote:
> >> >> > Hello,
> >> >> > I agree with Quentin (and Daniel). I plan to use apostrophe for one of
> >> >> > my client (a multilanguage website) , but it seems that aspostrophe
> >> >> > apostrophe doesn't manage URL internationalization. I checked the
> >> >> > project roadmap but i didn't see any tickets on that issue. Does
> >> >> > anyone know when (or if)i18nURL will be taken in account ?
> >> >> >> >> >I18N(thus making YAN over the YAN ^^).
> ...
>
> read more »