I have a template in ExactTarget (Salesforce Marketing Cloud), with 2 stacked tables, one EN and another FR. I need the EN to stay at the top and FR at the bottom for EN subscribers and FR at the top and EN at the bottom for FR subscribers.

There is a field in the data extension for the Language with 2 possible values, either EN or FR.

How can I do that with AMPScript? Remember, it's a template with editable fields.

Thanks, VD


2 Answers 2


I don't think you can get around this without duplicating at least one of the content areas. I would use Content Areas as previously suggested, which can be retrieved inside the Template and edited. I'd also opt for using the ContentAreaByName() function, which is much easier to manage.

My Contents > Hello_FR


My Contents > Hello_EN



var @lang
set @lang = AttributeValue("lang")

<br>@lang: %%=v(@lang)=%%

%%[ if @lang == "EN" then ]%%

  %%[ /* Retrieve from My Contents, Hello_EN and revise */ ]%%
  <custom type="content" name="EN Content 1"> 

%%[ endif ]%%

%%[ /* Retrieve from My Contents, Hello_FR  and revise */ ]%%
<custom type="content" name="FR Content"> 

%%[ if @lang == "FR" then ]%%

  %%[ /* Copy revised content from first Content Area above */ ]%%
  <custom type="content" name="EN Content 2"> 

%%[ endif ]%%

The process would be:

  1. Create the template
  2. Create the base content areas
  3. Create the email, based on the template
  4. Retrieve the content areas for EN and FR
  5. Copy the contents of the first EN content area into to the last
  6. Repeat steps 3-5 for each subsequent email
  • Thanks Adam but this won't work for the client since they want to edit the content through the WYSIWYG directly in the template edit mode...
    – Snowalker
    Aug 25, 2015 at 15:35
  • This will allow you to edit the content areas...with the WYSIWYG editor. Aug 25, 2015 at 15:36
  • hmm, I just saw now you are using AttributeValue which I never used. Maybe that's the key hehe
    – Snowalker
    Aug 25, 2015 at 21:01
  • All you'll need to do is set up the template and the create first set of language-specific content areas (as freeform) and then it's just a matter of retrieving the content areas and adjusting them with the WYSIWYG editor. Aug 25, 2015 at 21:31

I would make a content area for each of your tables. Then, use AMPscript to look up which comes first, Like so:

   SET @contentAreaID_EN = 12321123 /*or whatever value, could use name too */
   SET @contentAreaID_FR = 122342123 /*or whatever value */
   SET @first_content_lang = LOOKUPROWS(VARIABLES_GO_HERE) /*or some other lookup, you only need to do one lookup*/
   VAR @first_area_id, @second_area_id 
   IF(@@first_content_lang == 'EN') THEN
      SET @first_area_id = @contentAreaID_EN
      SET @second_area_id = @contentAreaID_FR
      SET @first_area_id = @contentAreaID_FR
      SET @second_area_id = @contentAreaID_EN

Then in your email, call each content area

%%=ContentArea(I1,S1,B1,S2,N1)=%% /* look at our help.exacttarget.com for the specifics of these calls.

Good luck!

  • thanks Timothy, the problem is the client doesn't wanna deal with Content Areas, they wanna be able to edit everything in the email based on the template using the editable fields...
    – Snowalker
    Aug 14, 2015 at 13:50
  • @kelly-j-andrews ?
    – Snowalker
    Aug 14, 2015 at 14:07
  • 1
    Then the answer is to put the tables in twice unfortunately, using an if block directly in the email.
    – Timothy
    Aug 14, 2015 at 15:25
  • yeah but that will duplicate the client efforts since they have to pour twice the content :(
    – Snowalker
    Aug 14, 2015 at 15:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .