I have a simple snippet to loop through a TV value for a folder of documents and output them as a list sorted by the TV values. However I’ve run into an issue that caused me to look more closely at the output of getTemplateVarOutput, and I discovered that it just returns all of the values with no separators (no ’||’ or spaces or anything else). This is causing me some grief, and since it might do the same for others I recommend that an optional separator variable be added to the function in future releases.
In my case, I have a bunch of member services as TV values. Two of these are "Marketing" and "Internet Marketing". Because there are no separators, I’m finding that any document with a value of "Internet Marketing" (but not "Marketing") is getting lumped in with the "Marketing" documents as well.
I am using the following code to determine if a particular document has a particular service checked:
if(strpos($memberTVs['services'],$thisService)!==FALSE){...output in here...}
If there were separators I could search for those at the beginning and end of the particular value I’m looking for. But since there aren’t I don’t think I can use this API at all in this circumstance. Granted there are always other ways to get at the data, but the API is meant to make life easier...
Is there anything I’m overlooking here, or am I right that this is an issue (with an easy resolution)?