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>

5
  • Please post some of the values you're using for @Title_Style? Jul 27, 2015 at 21:04
  • What type of Content Area is your code in? HTML only? Jul 27, 2015 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, 2015 at 13:18
  • Still curious about what values you're using in @Title_Style Jul 31, 2015 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, 2015 at 13:26

1 Answer 1

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>
2
  • Nice, much cleaner. Thanks @Adamspriggs ! I'll keep this in mind next time try this approach.
    – Stacy
    Aug 14, 2015 at 14:37
  • Please mark your question as answered if it helped you solve your challenge. Aug 19, 2015 at 18:11

You must log in to answer this question.

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