Forum

Thread tagged as: Question, Problem, Field-Types

Variable transmission to form in CMS

I'm working on a site that has a multi-lingual and each version is a separate directory (/en, /sk) and additionally holding current language in a globally available variable $ lang.

I make one of the regions through perch_content_create. This region produces the form in CMS based on the following template:

<perch:content id="description" type="textarea" label="Description" required="true" textile="true" editor="redactor" html="true" html="true" size="s" />
<perch:content id="manager_name" label="Portfolio manager" type="dataselect" page="/sk/our-team.php" region="Our team" options="name" allowempty="true" />
<perch:content id="manager" type="slug" for="manager_name" suppress="true" />
<perch:content id="show_navigation" type="checkbox" label="Show navigation" value="1" suppress="true" />

As you can see the argument "page" in dataselect contains a string stating for which language to choose a list of items to datasalect because I want to have a list of items depending on the language.

And now the question - how to pass a lang variable to the form in the CMS by each language (the structure is divided into / en and / sk and duplicate all pages) list was selected with the correct path?

Should I write my own FieldType who handle such a list?

Many thanks in advance for your help!

Pawel Jarosz

Pawel Jarosz 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, I think you'd need to customise a version of dataselect for that.

Drew, thank you for your confirmation!