Ticket #11 (new enhancement)

Opened 3 years ago

Last modified 2 years ago

Edit page category/locale selection

Reported by: dom Assigned to:
Priority: normal Milestone:
Component: openguides Version:
Severity: normal Keywords: check
Cc: crschmidt@crschmidt.net

Description

Sun Jan 9 09:46:19 2005 DOM - Ticket 9555 RefersTo? ticket 8203.

Sun Jan 9 09:46:19 2005 DOM - Ticket created [Reply] [Comment]

Subject: Edit page category/locale selection

In the edit node page, have the categories and locales be optionally selectable from a drop-down box of existing nodes, to reduce the number of mispellings/duplicates. Probably could use javascript to streamline this.

http://openguides.org/mail/openguides-dev/2005-January/000844.html

Download (untitled) 285b

Tue Oct 11 23:23:47 2005 EMARTIN - Correspondence added [Reply] [Comment]

Probably could use javascript to streamline this.

In discussions recently the idea of doing this via AJAX was raised.

I.e. Type: "c" and you get a dropdown with

Caribbean Food Chinese Food Chip Shops Churches Clothes

then type "h" and the list is reduced to

Chinese Food Chip Shops Churches

then type "i" and the list is reduced to

Chinese Food Chip Shops

and so on. And at any point you can click a category name to select it.

This is beyond my JavaScript? skills at present, but seems a realistic prospect: for a working example of this idea, see Google Suggest at http://www.google.com/webhp?complete=1

Change History

11/19/05 12:52:23 changed by ChristopherSchmidt

Another (easier) option for this would be to create a "tag map" style listing - just " * " seperating a list of entries, and each has onclick-javascript to modify the Categories or Locales box.

This is within the realm of my javascript, but outside the realm of my openguides knowledge. I suppose the best way to do it would probably be to provide a complete list of categories as local template data, and then use the template to create the appropriate javascript.

11/19/05 14:15:37 changed by ChristopherSchmidt

  • cc set to crschmidt@crschmidt.net.

Okay, so I've tossed something for this together on the Boston OpenGuides site.

    my $summariser = CGI::Wiki::Plugin::Summariser->new;
    $wiki->register_plugin( plugin => $summariser );
    my @categories = $summariser->metadata_list( type => 'Category' );
    my @locales = $summariser->metadata_list( type => 'Locale' );
    my %tt_vars = ( global_categories => \@categories,
                    global_locales => \@locales,
                    ...
  • Added some code to edit_form.tt:
[% FOREACH category = global_categories %]
   <a href='#' onclick="javascript:d=document.getElementById('categories');d.value = d.value + '[% category %]\n'; return false;">
   [% category %]
   </a> * 
[% END %]

and the same for locales.

It's not a *clean* solution by any means, but it works, and should get anyone else who's interested in attacking the problem a running start.

11/23/05 17:19:38 changed by dom

  • component set to openguides.

09/08/06 01:49:01 changed by dom

  • keywords set to check.

09/13/06 20:28:41 changed by dom

Nick has hacked together a rough "common categories and locales" thing for the benefit of Torchbox's design work; it's possible that these two things can be combined somehow.