I changed the the replacedTokenValue function so that is just replaces for example the [CreditInfo:ITEM] and leaves the other ones... If there is a better solution please let me know
public class TokenReplaceCredits : TokenReplace
{
public TokenReplaceCredits(CreditInfo credit)
: base(DotNetNuke.Services.Tokens.Scope.DefaultSettings)
{
this.UseObjectLessExpression = true;
//this.PropertySource[ObjectLessToken] = credit;
this.PropertySource["creditinfo"] = credit;
}
protected override string replacedTokenValue(string strObjectName, string strPropertyName, string strformat)
{
//return base.replacedTokenValue(strObjectName, strPropertyName, strformat);
if (strObjectName.ToLower().Equals("creditinfo"))
{
return base.replacedTokenValue(strObjectName, strPropertyName, strformat);
}
else
{
return string.format("[{0}:{1}]", strObjectName, strPropertyName);
}
/*string result = string.Empty;
if (strformat == string.Empty) strformat = "g";
if (strObjectName.ToLower() == "datetime")
{
if (strPropertyName.ToLower() == "today")
{
result = System.DateTime.Today.ToString(strformat);
}
else
{
result = System.DateTime.Now.ToString(strformat);
}
}
return result;*/
}