Forum

Thread tagged as: Problem, Addons, Blog

Blog app on a multi language page

Hi,

I have an issue on a multi-language page in which I used Blog app for writing news articles.

The site has two languages defined, each language page files sits in its own language directory. ../language1/ ../language2/

I have defined and created a perch page template for displaying blog posts and created different sections which filter posts for each language.

I have defined a path for blog posts in Perch settings page, blog section. ../language1/category/post.php?s={postSlug}

Every new article generated is displayed on that page. And that works fine for one language. When I switch to another language (../language2/) and click on an article, the url gets messed up because it uses path from first language. Also, because there is one-page template, navigation also switch to default language.......

Is there any workaround for this problem?

Thanks

Tomislav Jurisic

Tomislav Jurisic 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You can add other variables to the post URL, including your field for language selection.

So instead of

/language1/category/post.php?s={postSlug}

you could have something more like

/{lang}/category/post.php?s={postSlug}

That doesn't seem to work because I have created physical folders for languages.... This is the site structure:

/css/
/images/
/js/
/perch/
/language1/
/language2/
index.php - landing page for language selection
Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't think that should be a problem.