Forum

Thread tagged as: Question, Configuration

multilanguage site

I am embarking on a multi-language site. I have looked at your [article here] (https://docs.grabaperch.com/perch/building/how-do-i-create-a-multilingual-site/) I'll be using option 1 and creating a folder for each language. My question is, do I copy the entire perch app into each language folder? The article says "You would then build out your pages as normal." But doesn't specify where/how to add the templates. I want them to be able to add new pages for each language.

Also, how is access to the templates and admin area handled in the CMS? Is it for example, domain.com/en/perch/ for the admin for each language?

Kim Mazzola

Kim Mazzola 0 points

  • 4 years ago
Damian Drozdowicz

Damian Drozdowicz 0 points
Registered Developer

Hi Kim,

We've built few multi-language sites in the past in the similar way. You'd basically have one CMS ( Perch Admin ) for all the versions. The folder structure where you place all the files looks like this:

/
EN
- Page 1
- Page 2
- Page 3
-- Page 3.1
-- Page 3.2
DE
- Page 1
- Page 2
- Page 3
-- Page 3.1
-- Page 3.2

The CMS will pick up on this and create a similar structure within Pages tab once you visit any of these pages (DE/Page 3/Page 3.1)

I hope that helps. Damian

Damian,

It helps somewhat, thank you. However, I want them to be able to create new pages with new sections on-the-fly. This won't be a static site. That's more where my question is. It seems by your example the pages are already set up and placed in the root of the site with pre-configured regions, correct? I want more of a dynamic set up. Is that possible?

Damian Drozdowicz

Damian Drozdowicz 0 points
Registered Developer

Hey Kim,

It could be applied for both static and dynamic sites. You'd just have to rely more on routes rather than folder structure. Nonetheless, there is no need for having separated Perch Admin. You can set it up in the way that you'd be able to create new pages and access them for all the languages from domain.com/perch. If you aren't operating on $lang variable then you could create a set of templates within templates/content directory for each language variant.

Best, Damian

Sorry, but I'm getting rather confused by your answer. I'm simple ... very simple. ;-) I'm also visual so when I see things it's easier for me than reading them.

routes rather than folder structure???

You'd just have to rely more on routes rather than folder structure. Nonetheless, there is no need for having separated Perch Admin. You can set it up in the way that you'd be able to create new pages and access them for all the languages from domain.com/perch.

Would perch pick this up on it's own? For example, how would they get to the templates for the english version to create new pages? How are the pages displayed in the admin? How are they separated in the admin? Do I have to set this up or is it something perch handles?

If you aren't operating on $lang variable >>> I'm not

then you could create a set of templates within templates/content directory for each language variant. Would I set it up this way: templates/content/en >>>> have an entire set of templates here for english templates/content/es >>>> have an entire set of templates her for spanish (ETC for each language.)>

Again, I am new to this and don't want to create a ton of work for myself because I go about it the wrong way to start. I've done that once already and it was not fun. Sorry if these seem like silly questions.

Damian Drozdowicz

Damian Drozdowicz 0 points
Registered Developer

Hi Kim,

routes rather than folder structure???

Basically, you need to set up how your pages are reached by the user via Perch Routes (https://docs.grabaperch.com/runway/routing/). So for example a route for English pages would be /en/your-page, German /de/your-page and so on.

Would perch pick this up on it's own? For example, how would they get to the templates for the english version to create new pages? How are the pages displayed in the admin? How are they separated in the admin? Do I have to set this up or is it something perch handles?

You have to set up all the routes by yourself. If you have a different set of master pages for each language you can place them inside a /templates/pages/ ( ie. /templates/pages/en/default.php) so when you create a new page you can pick one up from the list. When you create an index page for ie. English version then you can set all the subsequent pages as children - in this way it would be very easy for the user to find their way around and to know on which language version they are operating.

I hope that helps! Damian

Damian,

Thank you for your patience with me. I do appreciate it. I don't have perch runway, I only have perch. I can upgrade, but at this point, this is a bit beyond my grasp of the app. I will look for a developer that can help me with this set up, thank you.