How to do you modify the URL created by a module? I have a module that creates a list of taxonomy terms. This is the module.

    function theme_jl_custom_category_list($vars) {
      $items = array();
      foreach (taxonomy_get_tree($vars['vid']) as $term) {
        $attributes = array();

       $query = new EntityFieldQuery;
       $query-&gt;entityCondition('entity_type', 'node')
         -&gt;fieldCondition('taxonomy_catalog', 'tid', $term-&gt;tid);

       if ($result = $query-&gt;execute()) {
         $nids = array_keys($result['node']);
       }
       if (isset($_GET['category']) &amp;&amp; $_GET['category'] == $term-&gt;tid &amp;&amp; $_GET['q'] == 'list-product') {
         $attributes['class'] = array('active-category');
       }

       /** How can I append &amp;product=[$nid][0] to this? **/
       $items[] = l($term-&gt;name, 'list-product', array('query' =&gt; array('category' =&gt; $term-&gt;tid), 'attributes' =&gt; $attributes));
      }

      return theme('item_list', array('items' =&gt; $items, 'attributes' =&gt; array('class' =&gt; array('jl-custom-category-list'))));
    }


In my template.php file, I have the following code.

function [THEME]_preprocess_page(&amp;$vars) {
  $vars['category_list'] = theme('jl_custom_category_list', array('vid' =&gt; 3));
  // …
}


In my page.tpl.php file I display the list with the following code.

&lt;?php print ($category_list);  ?&gt;


Combined, they create a list of links like the following ones:


http://example.com/list-product?category=12
http://example.com/list-product?category=14
http://example.com/list-product?category=17


I'm trying to modify these two pieces of code so that in the URL of each category I can append something like '&amp;product=(ID OF FIRST NODE IN EACH CATEGORY)' in the URL to change the links to the following ones:


http://example.com/list-product?category=12&amp;product=5
http://example.com/list-product?category=14&amp;product=10
http://example.com/list-product?category=17&amp;product=8


How can I modify the URL created by that module?
These are just hints to help yourself:


Take the Theme developer module, and check what functions are involved in putting the URL together.
Set a break point inside the l() function just before theme('jl_custom_category_list', array('vid' =&gt; 3)) gets executed. The stack should show you the code building the URL.