Embedding a search in a web page is really straightforward, all you need to do is drop a couple of lines of code pointing to an available Cadcorp Notice Board™ site!
See the online help here for more information.
If you can't see a search bar above, just edit line 25 of this file to point to your instance of Cadcorp Notice Board™ site:
<script src="http://YOURSERVER/YOURWEBSITE/GetSearch.axd?embeddedControlId=mySearch&controlTagId=searchPlaceholderTag&showgeolocate=true¬iceboardUrl=../noticeboard.aspx" type="text/javascript"></script>
The embedded search bar uses AJAX to get results from a web service. The website embedding the search bar AND the Notice Board™ website MUST be in the same domain or you have to enable Cross-Origin Resource Sharing (cors) in you noticeboard website.
There are 2 mandatory parameters that must be added to the url, they are:
There are several other parameter that can be added to the url to control the behaviour of the search bar
Finally a change must be made in the web.config file in your Notice Board™ directory.
At the bottom of the web.config there is a block of code which is commented out by default:
<!-- Allow Cross Origin Resource Sharing (cors) for QuickSearch.asmx-->
<!-- <location path="QuickSearch.asmx">
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Request-Method" value="GET,POST,OPTIONS" />
<add name="Access-Control-Allow-Headers" value="Origin, X-Requested-With, Content-Type, Accept" />
</customHeaders>
</httpProtocol>
</system.webServer>
</location> -->
To remove the comment delete <!-- from <!-- <location
and --> from the closing </location> -->