Last active
August 29, 2015 14:06
-
-
Save jhorsman/a99d094039aee4de8c3d to your computer and use it in GitHub Desktop.
Query SDL SmartTarget 2014 trough the new QueryBuilder API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get the triggers from ADF | |
ClaimStore claimStore = AmbientDataContext.CurrentClaimStore; | |
string triggers = AmbientDataHelper.GetTriggers(claimStore); | |
// make query builder and feed the triggers into it | |
var queryBuilder = new QueryBuilder(); | |
queryBuilder.Parse(triggers); | |
// set the publication id and SmartTarget region. Both are required to query | |
// for SmartTarget promotions | |
queryBuilder.AddCriteria(new PublicationCriteria(new TcmUri("tcm:0-69-1"))); | |
queryBuilder.AddCriteria(new RegionCriteria("Homepage Promotions")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment