1

I'm trying to use TREATASCONTENT() but getting error. As i want to use the data to control the dynamic module.

Pulling the data that drives the content i want:

Set @content1 = content1

Setting the content area:

SET @contentblock1 = ContentAreaByName("My Contents\Triggers\pre-post departures\@content1")

Pulling through the content block from above:

%%=TREATASCONTENT(@contentblock1)=%%

Error:

Content Area "My Contents\Triggers\pre-post departures\@content1" could not be found.

Any ideas?

Thanks in advance

1

You have to use the concat() function to ensure it will be evaluated as a variable, not a literal. Something like this:

%%[
    set @basePath = "My Contents\Triggers\pre-post departures\"  
    set @contentblock1 = ContentAreaByName(concat(@basePath,@content1))
]%%

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.