0

I have created content areas containing AMPScript variables in ExactTarget. In the area in which the variable is used, quotes are inserted.

After the %%v= and then after the closing %%. Does anyone know why this is happening or what I can do to stop this?

Below is an example:

(what I put into ExactTarget) <td valign="top" align="center" class="title_text" %%=v(@Title_Style)=%%>[Title Of The Item]</td>

(what it is being changed to) <td valign="top" align="center" class="title_text" %%=v"(@Title_Style)=%%">[Title Of The Item]</td>

  • Please post some of the values you're using for @Title_Style? – Adam Spriggs Jul 27 '15 at 21:04
  • What type of Content Area is your code in? HTML only? – Adam Spriggs Jul 27 '15 at 21:04
  • Hi Adam, yeah it was just HTML and it looks like it might have been a problem with the concatenation or that they were being used as inline styling. Trying a different approach – Stacy Jul 31 '15 at 13:18
  • Still curious about what values you're using in @Title_Style – Adam Spriggs Jul 31 '15 at 13:29
  • it was something like this Adam, SET @Title_Style = Concat('style="padding-bottom:5px; font-size:16px; color:',@Title_Color,';"') – Stacy Aug 14 '15 at 13:26
0

Here's how I would approach it:

%%[
var @title_style, @title_font, @title_color, @title_css
set @title_font = "sans-serif"
set @title_color = "#fff"
set @title_css = "padding: 0;"

set @title_style = "style='"
set @title_style = Concat(@title_style, "padding-bottom:5px; ")
set @title_style = Concat(@title_style, "font-family:", @title_font, "; ")
set @title_style = Concat(@title_style, "font-size:16px; ")
set @title_style = Concat(@title_style, "color:", @title_color, "; ")
set @title_style = Concat(@title_style, @title_css," ")
set @title_style = Concat(@title_style, "'")

]%%

<table>
    <tr>
        <td %%=v(@title_style)=%%>
            [Title Of The Item]
        </td>
    </tr>
</td>
| improve this answer | |
  • Nice, much cleaner. Thanks @Adamspriggs ! I'll keep this in mind next time try this approach. – Stacy Aug 14 '15 at 14:37
  • Please mark your question as answered if it helped you solve your challenge. – Adam Spriggs Aug 19 '15 at 18:11

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.