Skip to main content
UN Library logo
Research Guides

United Nations Digital Library

Instructions to Embed UNDL Search Box

Put a search box on your webpage

It is easy to add a UN Digital Library search box to any webpage. The search URL is constructed using regular GET parameters. This is how to do it.

1. To embed just the simple search box, put the following HTML code where you want it to appear on your site :

      <form name="search" action="https://digitallibrary.un.org/search" method="get">
            <input type="text" name="p" value="" />
            <input type="submit" name="action_search" value="Search" />
        </form>

  

You can append any style you want to this box

 

2. To add elements to refine the search to a certain collection, you can add a hidden input field for the collection attribute c.

This creates a textbox and maps the values to the c parameter of the search. For example, this box just searches in the Voting Data:

    <form name="search" action="https://digitallibrary.un.org/search" method="get">
            <input type="hidden" name="c" value="Voting Data"> 
            <input name="p" type="text" value="" /> 
            <input name="action_search" type="submit" value="Search" />
        </form>

  

 

3. To create a dropdown to allow users to select among collections. 

This creates a select dropdown and maps the values to the c parameter of the search. For example, use the following code to enable users to search in one of the three main collections of the UN Digital Library: Documents and Publications, Voting Data, and Speeches.

 <form action="https://digitallibrary.un.org/search" method="get" name="search">
            <select name="c">
            <option value="Documents and Publications">Documents and Publications</option>
            <option value="Voting Data">Voting Data</option>
            <option value="Speeches">Speeches</option>
            </select> 
            <input name="p" type="text" value="" /> <input name="action_search" type="submit" value="Search" /> 
        </form>