- You can use
BuildRowsetFromString
function to achieve the result Something like this:
%%[
set @categoryList = "News**Events"
set @categoryRows = BuildRowSetFromString(@categoryList, "**")
if RowCount(@categoryRows) > 0 then
for @i= 1 to RowCount(@categoryRows) do
set @row = Row(@categoryRows, @i)
set @Category = Field(@row, 1)
/* you put your processing here to pull the heading and text
E.g. LookupRows("NewsletterContent","Category", @Category)
so on....
*/
next @i
ENDIF
]%%
- To pull the data based on location, then you need to lookup at location attribute. Put a validation on location value to check whether the location is null, otherwise it shows the default content. I would do something like this
%%[
set @Location= AttributeValue("Location")
set @rows = LookupRows("NewsletterContent","Location", @Location)
if RowCount(@rows) > 0 then
/* pull the heading and text after that */
Put a validation on Text value to check whether the text is empty, otherwise it shows the default content
else
set @Text@heading = field(@row,"Text")
if Empty(@text)'default THENheading'
set @Text@text = 'default content'
ENDIF
]%%
Note: the code above is not the full code, you need to adjust based on what you need.