Add a search form to any TTG CE4 page

Search form added to the Galleries page
Search form added to the Galleries page

Would you rather have a search form out front on a web page rather than relying on your clients to click on a search link? It’s really easy to add a search form to any TTG CE4 page.

The code that puts the search form on the Search page is viewable by just looking at the page source (right-click on your page and choose “view page source”).

Just copy this code and, with a small change, use it in any TTG Page Copy(md) field.

Here’s the code to look for (or just copy this):

<div id="search" class="collapse clearfix">
<h2>Photo Search</h2>
<form action="./" method="GET">
<input type="text" id="q" name="q" value=""/>
<button type="submit">Search</button>
</form>
</div> <!-- #search -->

You’ll need to change one line though. Change this line:

<form action="./" method="GET">

to this:

<form action="/search" method="GET">

This assumes that your Search page is in the root of your site. If it’s not, then modify the path accordingly.

2 thoughts on “Add a search form to any TTG CE4 page”

  1. Thx for this nice tip.
    It is working fine … but after klicking on the search button I`m directed to the search page. (the one I get after clicking on the search menu.
    The behavior I expected is to stay on this site and get the search results on this page

    Kindly asking for a tip how to solve this issue
    Thomas

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About this site

This site is: a repository of time-savers and best practices from a user's perspective, picked up from several years of using TTG plugins.
This site is not: a support site.
Read more here.

Subscribe to new posts

Tip Jar

If this site has saved you some time, kept your hair attached, or otherwise prevented you from tossing the mouse through the monitor, feel free to donate.

Categories


Highly recommended. This is my go-to Lightroom book. Click on the book image. (affiliate link)

Affiliate link!

Current TTG versions

Backlight  4 & 5

See the Backlight Modules page on your site for latest Backlight and module versions and changelogs.

You’ll also find the latest version number and download link for the Lightroom Publisher plugin.
(BL 3 and later)

 

Backlight 1 Versions

Backlight 1.2.4
Pages module 1.2.4
Cart Add-on 4.1.7
Client Response Add-on 7.1.3
Theater Add-on 1.2.6
Galleria Add-on 1.0.0
WordPress Add-on 1.2.6
Publisher 3.2.3

Backlight 1 has seen its end of life. See this post.

CE4 Versions

note: CE4 is no longer being developed or sold. See this post.

TTG-BE: 2.0.5a
Autoindex: 7.0.8
Cart: 3.1.4a
CRG: 6.1.3a
Gallery: 6.1.10
Pages: 7.0.15
Publisher: 2.3.3
Stage: 6.1.6
Theme for WordPress: 3.1.2