Gravatar for

Question by Daniel Reedy, Apr 5, 2016 6:14 PM

configure search box control programmatically

I am able to render a Coveo Search Box in a sample page; however, I can't get it to work when I statically define the Coveo control in my own control like this:

<sc:Sublayout id="CoveoSearchBoxResources" runat="server" Path="/layouts/" />
<sc:Sublayout id="TCWSearchBox" runat="server" Path="/layouts/" />

I think it's because step #5 in these instructions is pending:

…so, my question is: how do I set [Unique identifier] and [Search page item id] at runtime in C#, or even in the markup?

1 Reply
Gravatar for

Answer by Daniel Reedy, Apr 7, 2016 1:24 PM

This has been resolved by Sitecore Support community:

The gyst is that I can pass them in the Parameters markup attribute:

<sc:Sublayout id="TCWSearchBox" runat="server" Path="/layouts/"
 Parameters="SearchBoxUniqueId=TCWSearchBoxId&SearchPageItemId={26446EE4-2985-4444-8012-BFD625095614}" />
Gravatar for

Comment by Jean-François L'Heureux, Apr 7, 2016 2:13 PM

Very good to know. I wasn't aware of that method. Thanks for sharing Daniel!

Ask a question