-1

I've been trying to get my custom email template in mailchimp to work with their building blocks. Been doing what the documentation is saying but i can't seem to get it to work.

I used mc:repeatable="content" & mc:variant="random name" The only thing i can do is add a block or remove one. I can't move them do another place of choose witch block i would to add.

How would i do this, so i can choose witch block i want to add where?

This is the code i've been using. Some help would be welcome, trying to wrap my head around this one for a while now.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta name="format-detection" content="telephone=no">
    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;">
    <meta http-equiv="x-ua-compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
    <title>Mailchimp test</title>
    <!--[if gte mso 9]>
    <style>
      /* Target Outlook 2007 and 2010 */
    </style>
    <![endif]-->
    
  <style type="text/css">
        #outlook a{
            padding:0;
        }
        .ExternalClass{
            width:100%;
        }
        .ExternalClass,.ExternalClass p,.ExternalClass span,.ExternalClass font,.ExternalClass td,.ExternalClass div{
            line-height:100%;
        }
        p{
            margin:0;
            padding:0;
            font-size:0;
            line-height:0;
        }
        table td{
            border-collapse:collapse;
        }
        table{
            border-collapse:collapse;
            mso-table-lspace:0;
            mso-table-rspace:0;
        }
        img{
            display:block;
            outline:none;
            text-decoration:none;
            -ms-interpolation-mode:bicubic;
        }
        a img{
            border:none;
        }
        a{
            text-decoration:none;
            color:inherit;
        }
        a.phone{
            text-decoration:none;
            color:#000001 !important;
            pointer-events:auto;
            cursor:default;
        }
        span{
            font-size:13px;
            line-height:17px;
            font-family:monospace;
            color:#000001;
        }
        .show-mobile{
            display:none !important;
        }
        .btn-gold a,.black-anchor a{
            color:#000000 !important;
        }
        .btn-black a,.white-anchor a{
            color:#ffffff !important;
        }
        img{
            max-width:100%;
            height:auto;
        }
    @media screen and (max-width: 583px){
        .mobile-logo{
            width:130px !important;
            height:35px !important;
        }

}   @media screen and (max-width: 583px){
        .mobile-sign{
            width:39px !important;
            height:40px !important;
        }

}   @media screen and (max-width: 583px){
        .mobile-container-full{
            width:92% !important;
        }

}   @media screen and (max-width: 583px){
        .mobile-width-full{
            width:100% !important;
        }

}   @media screen and (max-width: 583px){
        .mobile-block-intro-text-padding{
            height:30px !important;
        }

}   @media screen and (max-width: 583px){
        .mobile-row{
            width:100% !important;
            display:block !important;
        }

}   @media screen and (max-width: 583px){
        .show-mobile{
            display:block !important;
        }

}   @media screen and (max-width: 583px){
        .mobile-background-hide-mobile{
            background:none !important;
        }

}   @media screen and (max-width: 583px){
        .mobile-full-img img{
            width:100% !important;
            height:auto !important;
            max-width:100% !important;
        }

}</style></head>
  <body style="width:100%; margin:0; padding:0; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%;">
    <!--*|IF:MC_PREVIEW_TEXT|*-->
    <!--[if !gte mso 9]><!--><span class="mcnPreviewText" style="display:none; font-size:0px; line-height:0px; max-height:0px; max-width:0px; opacity:0; overflow:hidden; visibility:hidden; mso-hide:all;">*|MC_PREVIEW_TEXT|*</span>
    <!--<![endif]-->
    <!--*|END:IF|*-->
    <!-- page wrapper -->
    <table cellpadding="0" cellspacing="0" border="0" style="margin:0;padding:0;width:100%;line-height:100% !important;">
      <tr>
        <td valign="top">
          <!-- content wrapper -->
          <table cellpadding="0" cellspacing="0" border="0" align="center" width="584" class="mobile-container-full">
            <!-- Building blocks -->
            <tr>
              <td valign="top" align="left">
                <table cellpadding="0" cellspacing="0" border="0" align="center" width="100%">
                  <!-- block intro text -->
                  <tr mc:repeatable="content" mc:variant="intro text - white background">
                    <td valign="top" align="left" bgcolor="#ffffff">
                      <table cellpadding="0" cellspacing="0" border="0" align="center" width="100%" class="mobile-width-full">
                        <tr>
                          <td valign="top" align="left" height="45" class="mobile-block-intro-text-padding" style="height:45px;font-size:1px;line-height:1px;"></td>
                        </tr>
                        <tr>
                          <td valign="top" align="left">
                            <table cellpadding="0" cellspacing="0" border="0" align="center" width="100%">
                              <tr>
                                <td align="left" valign="top" width="30" style="width:30px;font-size:1px;line-height:1px;"></td>
                                <td align="left" valign="top">
                                  <table cellpadding="0" cellspacing="0" border="0" align="center" width="100%">
                                    <tr>
                                      <td valign="top" align="center">
                                        <span style="font-family:Arial, sans-serif;font-size:16px;line-height:20px;color:#C89619;text-transform:uppercase;" mc:edit="intro_text_title">Lorep Ipsum 1</span>
                                      </td>
                                    </tr>
                                    <tr>
                                      <td valign="top" align="center" height="16" style="height:16px;font-size:1px;line-height:1px;"></td>
                                    </tr>
                                    <tr>
                                      <td valign="top" align="center">
                                        <span style="font-family:Arial, sans-serif;font-size:12px;line-height:20px;color:#000000;" mc:edit="intro_text_text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</span>
                                      </td>
                                    </tr>
                                    <tr>
                                      <td valign="top" align="left" height="20" style="height:20px;font-size:1px;line-height:1px;"></td>
                                    </tr>
                                    <tr>
                                      <td align="left">
                                        <!-- button -->
                                        <table cellpadding="0" cellspacing="0" border="0" align="center" bgcolor="#C89619" class="mobile-width-full btn-gold">
                                          <tr>
                                            <td align="left" valign="top" width="15" style="width:15px;font-size:1px;line-height:1px;"></td>
                                            <td align="left" valign="top">
                                              <table cellpadding="0" cellspacing="0" border="0" align="center">
                                                <tr>
                                                  <td valign="top" align="left" height="12" style="height:12px;font-size:1px;line-height:1px;"></td>
                                                </tr>
                                                <tr>
                                                  <td>
                                                    <table cellpadding="0" cellspacing="0" border="0" align="center">
                                                      <tr>
                                                        <td valign="middle" align="center">
                                                          <strong class="black-anchor" style="font-family:Arial, sans-serif;font-size:12px;color:#000000 !important;font-weight:bold;text-decoration:none;" mc:edit="intro_text_link">
                                                            Read more
                                                          </strong>
                                                        </td>
                                                      </tr>
                                                    </table>
                                                  </td>
                                                </tr>
                                                <tr>
                                                  <td valign="top" align="left" height="12" style="height:12px;font-size:1px;line-height:1px;"></td>
                                                </tr>
                                              </table>
                                            </td>
                                            <td align="left" valign="top" width="15" style="width:15px;font-size:1px;line-height:1px;"></td>
                                          </tr>
                                        </table>
                                        <!-- end button -->
                                      </td>
                                    </tr>
                                  </table>
                                </td>
                                <td align="left" valign="top" width="30" style="width:30px;font-size:1px;line-height:1px;"></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                        <tr>
                          <td valign="top" align="left" height="45" class="mobile-block-intro-text-padding" style="height:45px;font-size:1px;line-height:1px;"></td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                  <!-- end block intro text -->
                  <!-- block intro text -->
                  <tr mc:repeatable="content" mc:variant="intro text - black background">
                    <td valign="top" align="left" bgcolor="#000000">
                      <table cellpadding="0" cellspacing="0" border="0" align="center" width="100%" class="mobile-width-full">
                        <tr>
                          <td valign="top" align="left" height="45" class="mobile-block-intro-text-padding" style="height:45px;font-size:1px;line-height:1px;"></td>
                        </tr>
                        <tr>
                          <td valign="top" align="left">
                            <table cellpadding="0" cellspacing="0" border="0" align="center" width="100%">
                              <tr>
                                <td align="left" valign="top" width="30" style="width:30px;font-size:1px;line-height:1px;"></td>
                                <td align="left" valign="top">
                                  <table cellpadding="0" cellspacing="0" border="0" align="center" width="100%">
                                    <tr>
                                      <td valign="top" align="center">
                                        <span style="font-family:Arial, sans-serif;font-size:16px;line-height:20px;color:#C89619;text-transform:uppercase;" mc:edit="intro_text_black_title">Lorem Ipsum 2</span>
                                      </td>
                                    </tr>
                                    <tr>
                                      <td valign="top" align="center" height="16" style="height:16px;font-size:1px;line-height:1px;"></td>
                                    </tr>
                                    <tr>
                                      <td valign="top" align="center">
                                        <span style="font-family:Arial, sans-serif;font-size:12px;line-height:20px;color:#ffffff;" mc:edit="intro_text_black_content">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</span>
                                      </td>
                                    </tr>
                                    <tr>
                                      <td valign="top" align="left" height="20" style="height:20px;font-size:1px;line-height:1px;"></td>
                                    </tr>
                                    <tr>
                                      <td align="left">
                                        <!-- button -->
                                        <table cellpadding="0" cellspacing="0" border="0" align="center" bgcolor="#C89619" class="mobile-width-full btn-gold">
                                          <tr>
                                            <td align="left" valign="top" width="15" style="width:15px;font-size:1px;line-height:1px;"></td>
                                            <td align="left" valign="top">
                                              <table cellpadding="0" cellspacing="0" border="0" align="center">
                                                <tr>
                                                  <td valign="top" align="left" height="12" style="height:12px;font-size:1px;line-height:1px;"></td>
                                                </tr>
                                                <tr>
                                                  <td>
                                                    <table cellpadding="0" cellspacing="0" border="0" align="center">
                                                      <tr>
                                                        <td align="center">
                                                          <strong class="black-anchor" style="font-family:Arial, sans-serif;font-size:12px;color:#000000 !important;font-weight:bold;text-decoration:none;" mc:edit="intro_text_black_link">Read more</strong>
                                                        </td>
                                                      </tr>
                                                    </table>
                                                  </td>
                                                </tr>
                                                <tr>
                                                  <td valign="top" align="left" height="12" style="height:12px;font-size:1px;line-height:1px;"></td>
                                                </tr>
                                              </table>
                                            </td>
                                            <td align="left" valign="top" width="15" style="width:15px;font-size:1px;line-height:1px;"></td>
                                          </tr>
                                        </table>
                                        <!-- end button -->
                                      </td>
                                    </tr>
                                  </table>
                                </td>
                                <td align="left" valign="top" width="30" style="width:30px;font-size:1px;line-height:1px;"></td>
                              </tr>
                            </table>
                          </td>
                        </tr>
                        <tr>
                          <td valign="top" align="left" height="45" class="mobile-block-intro-text-padding" style="height:45px;font-size:1px;line-height:1px;"></td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                  <!-- end block intro text -->
                </table>
              </td>
            </tr>
            <!-- / Building blocks -->
          </table>
          <!-- / content wrapper -->
        </td>
      </tr>
    </table>
    <!-- / page wrapper -->
  </body>
</html>
  • You may have better chances for an answer if you [edit] your question and reduce that code to a [mcve] and describe clearly what the problem is... "not working" is not helpful. What happens, and what did you expect to happen instead? Any errors? See also [ask]. – Robert Dec 10 '20 at 16:40

2 Answers2

2

Mailchimp documentation says that "Custom-coded email templates do not include drag-and-drop content blocks. Use Mailchimp’s template language to add editable regions to your custom-coded emails." (https://mailchimp.com/help/about-content-blocks/)

Therefore your experience seems as expected: "The only thing i can do is add a block or remove one. I can't move them to another place..."

The template language indicates that mc:repeatable and mc:variant can be used together to switch on and off a 'variant' - like you have done and experience already. (https://templates.mailchimp.com/getting-started/template-language/)

In summary, your expectations are incorrect, that you can move blocks around as you wish. That behaviour only works with MailChimp's templates.

Nathan
  • 4,358
  • 2
  • 10
  • 26
  • Hey, Thanks for the comment. We used to have a template where this was possible tho, but that does not seems to work annymore. What I'm expecting is something like this: (https://mailchimp.com/help/repeatable-or-variable-content-blocks/#Change_block_type) As explained here, there should be an option to display a dropdown and pick which content type you want. Away an indicator to change the position. – Arno Ramon Dec 11 '20 at 08:03
  • I'd suggest reaching out to MailChimp customer service; it may be to do with their new builder, which is different to what they're now calling 'classic builder'? I.e. they may have changed things recently – Nathan Dec 14 '20 at 05:38
0

You absolutely can create repeatable content blocks that can be repositioned in a custom template. From Mailchimp's documentation...

If you code your own email template, you can use Mailchimp’s Template Language to add repeatable and variable content blocks to your layout. These blocks help you to create a customized design that can be modified in the Campaign Builder. Even if someone else built your template, you’ll still be able to repeat, delete, reposition, and edit the content blocks.'

The position arrow appears over the left edge of each layout variant so you can drag and drop them into position vertically. You cannot position elements within a layout variant.

Check out the screenshot for visual reference.

One wonky thing that does happen and is likely the case with your example, is blocks are only positionable when more than three blocks are added.

https://mailchimp.com/help/repeatable-or-variable-content-blocks/

  • Hey, thanks for the reply! The thing is that i don't see the dropdown, i even contacted the support of mailchimp but they don't understand why. As you can see here: https://ibb.co/Ws7QWVs – Arno Ramon Jan 14 '21 at 07:37