Skip to content

Search input feld in Navbar

This creates an additional search input field in your top navbar.

The search string you enter there will be posted to a serverside script (parameter: url ) which you can code on your own for customized searching and listing of results.

1
2
var navbar = AppGiniHelper.getCommon().getNavbar();
navbar.addSearch("url", "placeholder", "value");

Example

1. Create search input field in Navbar

1
2
3
4
5
// file: hooks/header-extras.php
<script>
var navbar = AppGiniHelper.getCommon().getNavbar();
navbar.addSearch("my_searchpage.php", "Search...", "");
</script>

2. Implement search function

Create a new file my_searchpage.php and implement search function and listing of matches

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
<?php
include("language.php");
include("lib.php");
include("header.php");

$searchstring = $_REQUEST["SearchString"];

// your code for searching here
// your code for listing matches here

include("footer.php");

See also