Ticket #81 (new enhancement)

Opened 3 years ago

Last modified 2 months ago

Make "Category" and "Locale" prefixes in autogenerated nodes optional or customisable

Reported by: grimoire Assigned to:
Priority: normal Milestone:
Component: openguides Version: svn
Severity: normal Keywords: templates utils indexes
Cc:

Description

I believe that having "Category" and "Locale" prefixed to the name of a node is redundant and counterintuitive for users. A node is a category if it is in category Category, and a locale if it is in category Locale. Also, my Guide is becoming full of redirects from Locale Foo to Foo, and Category Bar to Bar (and occasionally from both Locale Foo and Category Foo to Foo).

Several places in the OpenGuides code seem to require that locales and categories have node names prefixed with this information, so it's easier said than done, sadly.

Attachments

ticket_81.patch (15.0 kB) - added by grimoire on 02/22/06 00:39:50.
Patch against [735] for customisable locale / category prefixes
sniplocales.pl (2.9 kB) - added by grimoire on 08/02/06 18:17:58.
Script to rename "Locale Foo" to "Foo" and set up redirects. Probably only works with pre-W::T versions of OpenGuides.

Change History

02/17/06 03:03:09 changed by grimoire

In OpenGuides.pm, it is assumed that a node is either a category (i.e. its name begins with "Category") or a Locale (i.e. its name begins with "Locale"). It uses this to generate some template variables which, by default, change the node title link if backlinks_in_titles is enabled. If this ticket is resolved, nodes can be both categories and locales, so this behaviour needs to be altered or worked around somehow.

02/17/06 05:02:17 changed by grimoire

It's also worth noting that the @INDEX_LINK macro provided by OpenGuides::Utils breaks if a locale or category node doesn't start with "Locale " or "Category ". I suspect a *better* way to do this is not to use the macro, but instead to generate TT variables if the node is a category or locale and generate the index link there. This will of course bugger up existing guide content.

02/17/06 05:03:34 changed by grimoire

Note that you can't have a prefix without a space - Config::Tiny seems to chop trailing spaces, so I'm automatically inserting one if a prefix variable is set.

02/17/06 06:48:02 changed by grimoire

On reflection, I've replaced the @INDEX_LINK macro with a @LOCALE_LINK and @CATEGORY_LINK.

02/17/06 20:02:06 changed by grimoire

  • owner changed from dom to grimoire.
  • version changed from 0.51 to svn.

Right, I think I'm about done with this, nearly ready to append a .patch file for my changes. It's worth noting that changing the prefixes on an existing guide will be moderately painful - you'll need to rename all the nodes in category "Category" and/or "Locale", from their fixed prefix to your custom one, and renaming nodes is currently painful. The proposed CGI::Wiki database refactoring will make this easier, I guess.

02/17/06 23:56:40 changed by earle

See also #52.

02/22/06 00:39:50 changed by grimoire

  • attachment ticket_81.patch added.

Patch against [735] for customisable locale / category prefixes

03/05/06 12:19:05 changed by dom

  • milestone set to 0.53.

04/20/06 11:03:18 changed by dom

  • milestone changed from 0.53 to 0.54.

I'm leaving this until 0.54 when we will have refactored Wiki::Toolkit.

04/25/06 18:31:32 changed by earle

  • keywords set to templates utils indexes.

The patch supplied (thanks Dave) leaves the existing prefixes in as default. I think they should default to empty, as the prefixes are getting on for 4 years old as a UseMod legacy holdover. Deprecate, deprecate!

Before this is released, we should have a run-once script that moves all content and metadata from name-prefixed nodes into non-prefixed versions and replaces the old ones with redirects.

08/02/06 18:12:56 changed by grimoire

earle, are you suggesting that the patch should just remove name prefixes for nodes or should default to having none?

I had such a script lying around, I will try to unearth and revive it.

08/02/06 18:17:58 changed by grimoire

  • attachment sniplocales.pl added.

Script to rename "Locale Foo" to "Foo" and set up redirects. Probably only works with pre-W::T versions of OpenGuides.

12/11/06 15:18:59 changed by dom

  • owner changed from grimoire to earle.
  • milestone deleted.

Earle, you seemed to be interested in this one during discussions in the hackfest; assigning to you for now.

06/26/08 02:54:36 changed by earle

  • owner deleted.