Hi,
To summarize our parallel conversation and provide information for others:
It is possible to use
macro with parameters or the
custom function.
Custom macro code could pick the document's custom field value (i_Interests) from the context... e.g. using:
...
string FieldToSplit = ValidationHelper.GetString(CurrentDocument.GetValue("i_Interests"),"");
// do whatever you need
// set result= corrected expression
....
However, if the key trick is the replace method, then in
Kentico CMS version 5.5 or higher, it could be performed also through
macro parameter (replace), please see details at:
devnet.kentico.com/Blogs/Martin-Hejtmanek/June-2010/New-in-5-5--Macro-parameters.aspxThen, your where condition could be something like:
t_Sector LIKE '%{%i_Interests|(replace)\|(with)%' OR t_Sector LIKE '%%}%'
What might be a problem is that our webparts use
SQL injection protection that unfortunately doubles the quotes in the wherecondition string.
Each web part should inherit from
CMSAbstractWebPart class, like Repeater web part. This CMSAbstractWebPart class contains definition for SQLProperties (this property is intended for SQL injection prevention). So, if you are using
CMS Repeater web part, please try to use following code in
SetupControl method of that web part (CMSWebParts\Viewers\(Documents)\cmsrepeater.ascx.cs):
this.SQLProperties = "";Similar issue was recently discussed in our forums
here, the above text quotes Miro's explanation.
Please also note, we would recommend to use cloned version of the repeater, so that you know that a the particular one has SQL injection protection disabled, and you won't loose the change during future upgrades.
Regards,
Zdenek