Wordpress hierarchical, multilanguage, seo friendly url structure with ember-cli


#1

Hi Guys,

I am building a corporate site with WP. The content structure will result in a hierarchical page structure, where I want the urls to look like this: http://ember-wpsite.com/mainpage-slug-in-english/subpage-slug-in-english http://ember-wpsite.com/mainpage-slug-in-german/subpage-slug-in-german

Right now, I am trying to make this work with ids in the url, but it only works for the main page. When I try to navigate to a subpage (after setting up the nested route for it), the subpage template won’t render (not even without dynamic elements).

My router.js config:

Router.map(function() {
    this.resource('pages');
    this.resource('page', {path: ':page_id'}, function() {
        this.resource('subpage', {path: ':subpage_id'});
    });    
});

Ember inspector shows the subpage route:

/:page_id/:subpage_id 

I placed subpage.js in routes/page .

I want to make this multilingual using Polylang. There is a plugin called JSON REST API which lists the id of the german, english etc. versions of a post or page, so I guess it is possible to find the appropriate version using this when the visitor switches language, but I still have to figure out how to show the language he switched to when he navigates to another page, without checking the lang id in the default language version of the post.

Any ideas?