http://code.google.com/p/gantry/source/detail?r=1492
Modified:
/trunk/Changes
/trunk/lib/Gantry/Docs/Cookbook.pod
/trunk/lib/Gantry.pm
=======================================
--- /trunk/Changes Thu Jun 16 08:23:55 2011
+++ /trunk/Changes Tue Jun 21 07:32:32 2011
@@ -1,5 +1,8 @@
This file documents the revision history for Perl extension Gantry
+3.81 Tue Jun 21 09:30:00 CDT 2011
+ - Added livesearch how-to to Cookbook pod contributed by Bill Dudley.
+
3.80 Thu Jun 16 10:22:00 CDT 2011
- Fixed sample included with gantry so livesearch works.
=======================================
--- /trunk/lib/Gantry/Docs/Cookbook.pod Tue May 22 14:16:55 2007
+++ /trunk/lib/Gantry/Docs/Cookbook.pod Tue Jun 21 07:32:32 2011
@@ -57,6 +57,10 @@
L<What is Submit and Add Another? How do I turn it on?>
+=item *
+
+L<How do I enable live searching?>
+
=back
=head1 How do I run the samples?
@@ -826,3 +830,104 @@
to the C<extra_keys> for the form. Note that there is no specific
keyword for this. You can set any key in the forms hash by adding
it to C<extra_keys>.
+
+=head1 How do I enable live searching?
+
+=over 4
+
+=item 0.
+Make sure you have latest bigtop and gantry, the CPAN version is old:
+
+ for PACKAGE in "gantry" "bigtop" ;
+ do
+ svn checkout http://${PACKAGE}.googlecode.com/svn/trunk/
${PACKAGE}-read-only
+ cd ${PACKAGE}-read-only
+ perl Build.PL
+ ./Build
+ ./Build test
+ ./Build install
+ # or sudo ./Build install, depending on where your install dir is
+ cd ..
+ done
+
+=item 1.
+make sure searchable is enabled for one or more fields in your bigtop file:
+
+ field customer_name {
+ is varchar;
+ label Customer;
+ searchable 1;
+ }
+
+=item 2.
+make sure livesearch is enabled in the do_main in your bigtop file
+for each table that you want searchable:
+
+ method do_main is main_listing {
+ header_options Add;
+ . . .
+ livesearch 1;
+ }
+
+=item 3.
+IF you're using app.server (as opposed to running under Apache),
+then in the config section of your bigtop file, make sure you
+have a line including the "Static" plugin:
+
+ config {
+ engine ---;
+ template_engine ---;
+ . . .
+ plugins `AuthCookie Static`;
+ . . .
+ }
+
+The tentmaker editor has a box for that (called "Plugins") under the
+"Bigtop Config" tab.
+
+=item 4.
+Copy gantry.js and jquery.js to your html/js directory if they
+are not already there. You should be able to find a copy in your
+"main" gantry repository, or in the html/js directory of the
+samples tree that was part of the svn distribution.
+
+You can test that these files are served by trying these URLs in
+your browser (URLs assume you're running app.server):
+
+http://localhost:8080/static/js/jquery.js
+http://localhost:8080/static/js/gantry.js
+
+A 404 means you have a problem.
+
+=item 5.
+Add the following lines to genwrapper.tt in html/templates:
+
+ <title>[% view.title %]</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+ + <script type="text/javascript" src="[% self.doc_rootp %]/js/jquery.js">
+ + </script>
+ + <script type="text/javascript" src="[% self.doc_rootp %]/js/gantry.js">
+ + </script>
+
+ <!-- include a style sheet if you like:
+ <link rel="stylesheet" type="text/css" media="screen"
+ title="Default" href="[% self.doc_rootp %]/css/default.css" />
+ -->
+
+Copy this file to some other name, like genwrapper.tt.save, so you can
+restore genwrapper.tt after bigtop re-writes it without these lines,
+which it will do.
+
+=item 6.
+You can get some debugging information on the javascript portion
+of this problem by using the browser's javascript console:
+
+"The best way to debug it is use the Chrome web browser. View -> Developer
->
+Javascript Console. If there are any javascript errors occurring you
+should be able to see them. If there are no js errors then the problem may
+be with the controller."
+
+If you're unfamiliar with javascript then this will not be terribly
helpful.
+
+=back
=======================================
--- /trunk/lib/Gantry.pm Thu Jun 16 08:23:55 2011
+++ /trunk/lib/Gantry.pm Tue Jun 21 07:32:32 2011
@@ -11,7 +11,7 @@
############################################################
# Variables #
############################################################
-our $VERSION = '3.80';
+our $VERSION = '3.81';
our $DEFAULT_PLUGIN_TEMPLATE = 'Gantry::Template::Default';
our $DEFAULT_STATE_MACHINE = 'Gantry::State::Default';
our $CONF;