Jump to content

How to make a language switch?


NPN

Recommended Posts

I have a business card where the client want to two versions, one in Norwegian and one in English. The VDP is published on Digital Store Front where the end user fill out the html form and generate the business card.

 

I made the first card, duplicated it and changed some language. However I know it's possible to have both languages in the same VDP. What is the best way to go about this? The business card has all the standard fields, and one pick list that produces a sub logo(in text), the sub logo should also change language based on selection.

 

I imagine a pick list in the beginning of the form where the end user choose which language the card should be in. What I don't know is how to call upon this choice in the rest of the code.

 

Can anyone point me in the right direction?

Link to comment
Share on other sites

NPN,

For sake of this example I will assume the Bus Card language only affects one side; where the back is the same or blank.

 

By default all pages are "In use", so you can simply tell the template which page you want turned off. The example below uses named pages; defined at FusionPro > Manage Pages > Page Usage. Each of the relevant pages must be in sequential order in the layout, so that when they are active they will be page 1 in the output. I also have a field indicating the language, which is used to trigger the deactivation:

 

if (Field("Language")== "English")

{

FusionPro.Composition.SetBodyPageUsage("Norwegian", false);

}

 

else if (Field("Language")== "Norwegian")

{

FusionPro.Composition.SetBodyPageUsage("English", false);

}

--------------------------------------

You could also indicate that both pages in question are not in use (also set in FusionPro > Manage Pages > Page Usage), then you can activate pages by using the field value in the PageUsage function:

 

FusionPro.Composition.SetBodyPageUsage(Field("Language"), true);

--------------------------------------

 

Either option requires an OnRecordStart - Callback rule and the relevant page should show up in the preview. Keep in mind that the inactive page will still show in the preview, none of the values will display, but it will not compose when out put.

 

 

There are a number of other posts for how to achieve this:

Activating a backside page

Activating a range of pages

Activating/deactivating pages

OnCall Page Usage

 

Hope this helps

Link to comment
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...