Coded something up in Couch in an interesting way? Have a snippet or shortcode to share? Post it here for the community to benefit.
3 posts Page 1 of 1
This is something i've seen been requested, so after some try and error i found this:

http://koalyptus.github.io/TableFilter/index.html

Steps

1.- Get the admin template (default_list or my_list snippets) from the Databound Forms tutorial.
2.- Extract the attached files in your couch addons folder. (Or download it from the link above).
3.- Add an ID to the table (any ID will do) and the js file required ABOVE the table:
Code: Select all
<script type="text/javascript" src="<cms:show k_couch_link/>addons/tablefilter/tablefilter.js"></script>
    <table id="tableidijustmadeup" class="listing clear" cellspacing="0" cellpadding="0">


4.- Add this or something alike BELOW the table:
Code: Select all
<script>
    var filtersConfig = {
      base_path: '<cms:show k_couch_link/>addons/tablefilter/',
      col_0: 'none',
      col_2: 'select',
      col_3: 'select',
      col_4: 'none',
      loader: true,
      mark_active_columns: true,
      highlight_keywords: true,
      auto_filter: true,
      extensions:[{ name: 'sort' }]
    };
   var tf = new TableFilter('tableidijustmadeup', filtersConfig);
      tf.init();
</script>

NOTE: Adjust the ID to match. This is configured to use "filter while writting" by default and hide the "select" on the first column (the one with the check marks.

5.- OPTIONAL: Remove or adjust the limit of the table, as it will only search in the currently shown pages (so, if you're showing 25 pages, it will only search in those).

Code: Select all
<cms:pages masterpage=k_template_name folder=my_selected_fname paginate='1' limit='0' show_unpublished='1' >


That's all.
You should get a nice and dandy searchbox. Hope this helps someone.
Best regards

Attachments

LordNeo wrote: This is something i've seen been requested, so after some try and error i found this:


I got the search box..

..But unfortunately when I type something into it nothing happens. Is this search box function working for anyone else?
I was blown away by Airsnore and how well it works.
Lowley wrote: I got the search box..

..But unfortunately when I type something into it nothing happens. Is this search box function working for anyone else?

Does it list all your pages from that template?
Sorry for the late reply
3 posts Page 1 of 1