Documentation Center

Implementing navigation links using the API

You can implement navigation links using the SmartTarget Content Delivery API. The API allows you to handle the facet map returned by a query instead of using TCDL tags.

About this task

To implement navigation links using the API, you need to get the Tridion.SmartTarget.Query.Link.QueryString and output that as the URL of your hyperlink. When clicking the link, you can pass the QueryString as the params parameter into the Tridion.SmartTarget.Query.Execute(string params, string searchTerm, string triggers) method.

The following example outputs a hyperlink:

<asp:HyperLink NavigateUrl="<%#'?' + ((Link)Container.DataItem).QueryString  %>" runat="server">"> 
<%# ((Link)Container.DataItem).Title %> 
(<%# ((Link)Container.DataItem).ItemCount %>)
</asp:HyperLink>

The following example uses the selected value in a query:

Query query = new Query();
    ResultSet resultSet = (ResultSet)query.Execute(Server.UrlDecode(Page.Request.QueryString.ToString()), null, null);