I am trying to create a custom email module that will output 2 columns.
If there are more than 2 items in my repeater, the items show in a single row. (See Here) Any ideas how to achive this for a responsive email? CSS float is not supported in outlook email so cant use it.
@SStrachan Not sure have your fields set up but you'll want Yacht Photos as a group repeater and then Columns as a group repeater with hero photo and broker email inside the column repeater. Like so:
Then in your code you'll have a for loop for the rows (place the hse-column-container inside this for loop as well) and a for loop for the columns. Also, put a width on your images else they'll oveflow the body if they're too big.
@SStrachan Not sure have your fields set up but you'll want Yacht Photos as a group repeater and then Columns as a group repeater with hero photo and broker email inside the column repeater. Like so:
Then in your code you'll have a for loop for the rows (place the hse-column-container inside this for loop as well) and a for loop for the columns. Also, put a width on your images else they'll oveflow the body if they're too big.
@webdew What do you mean the repeater is not working in email templates? The repeater is working for me, I am just having trouble with the html wrapping the items to be 2 columns.
First things first, you should do the iteration inside the <tbody> tag so you could control the number of rows/column you produce, right now what happens according to the code is that you are creating, so you will end up with a code for the module that looks like below:
And then inside your email template in the style tag put the following css:
/*<![CDATA[*/
/* everything in this style tag will be inlined onto matching elements */
@media only screen and (max-width: 480px){
#templateColumns{
width:100% !important;
}
.templateColumnContainer{
display:block !important;
width:100% !important;
}
.columnImage{
height:auto !important;
max-width:480px !important;
width:100% !important;
}
.leftColumnContent{
font-size:16px !important;
line-height:125% !important;
}
.rightColumnContent{
font-size:16px !important;
line-height:125% !important;
}
}
/*]]>*/
This should create the responsive email. Note: I'm using heavily mailchimp's reccommendation on this topic as I aknowledge them as masters of email technology 😛 you can find more info in this link
If my answer was helpful please mark it as a solution
Hey there @SStrachan, I probably don't get what you need to accomplish, your screenshot shows three items in a row, and you mention you need the items in one row, this is quite the result I'm getting. can you share a picture with three or more items with the result you need on desktop and on mobile?