0

I have a Landing page (a form) multi-language, and I would like to put some flags in the corner and when the user clicks in one of them, reload the LP with the correct content from the Data Extension depending of the language. Is that possible?

1 Answer 1

1

Sure, it's possible.

The onChange/reload will have to be done with client-side JavaScript.

I'd suggest using server-side JavaScript to do the retrieval of the data before the page loads.

Here's the SFMC Custom Preference Center Boilerplate that I use.

I'd start there for retrieving the parameter value when the page reloads -- mainly using one of these:

Once you have the selected language, you can just use the the SSJS Data Extension functions to retrieve the DE data:

var testDE = DataExtension.Init("testDE");
var data = testDE.Rows.Lookup(["Age"], [25], 2, "LastName");

Here's another example from Retrieve Rows from a Data Extension:

<script runat="server">  
Platform.Load("Core","1.1.1");
var layouts = DataExtension.Init("ImportResults").Rows.Retrieve();
for (var i = 0; i < layouts.length; i++) 
{
    Write("<tr>");
    Write("<td>" + layouts[i].requestID + "</td>");
    Write("<td>" + layouts[i].conversationID + "</td>");
    Write("<td>" + layouts[i].overallStatusCode + "</td>");
    Write("<td>" + layouts[i].statusCode + "</td>");
    Write("<td>" + layouts[i].statusMessage + "</td>");
    Write("<td>" + layouts[i].errorCode + "</td>");
    Write("<td>" + layouts[i].requestType + "</td>");
    Write("<td>" + layouts[i].sequenceCode + "</td>");
    Write("<td><pre>" + layouts[i].resultDetailXML + "</pre></td>");
    Write("</tr>");
}
//Write(Stringify(layouts));
1
  • Thank you very much Adam :) I'll inform you when it´s done ;)
    – manukadi
    Mar 16, 2017 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.